format now()

aftershokk

Registered User.
Local time
Today, 19:30
Joined
Sep 5, 2001
Messages
259
I have a query where I extract today's date and time using now() but need the extracted file to display the date/time as YYYY-MM-DD HH:MM:SS

any help is greatly appreciated
 
thanks

I used:

DATETIME_GENERATED: Year(Now()) & "-" & Month(Now()) & "-" & Day(Now()) & " " & Hour(Now()) & ":" & Minute(Now()) & ":" & Second(Now())
 
Hi -

This appears to get it. From the debug window:

? format(now(), "YYYY-MM-DD HH:MM:SS")
2007-12-11 10:27:17

Bob
 
And just an FYI, but the better code for minutes is NN not MM. MM may work MOST of the time but there are times where it might not, but NN is guaranteed to work.
 

Users who are viewing this thread

Back
Top Bottom