HOw to get date and time

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
mfauzim
Pro Scripter
Posts: 89
Joined: Wed Sep 13, 2006 10:57 am

HOw to get date and time

Post by mfauzim » Tue Oct 17, 2006 9:40 am

How do I get datetime in MS so that I can insert the value into my MSSQL fieldtype datetime. I understand MS only has getdate and gettime not getdatetime

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Tue Oct 17, 2006 9:56 am

Use the Year, Month, Day, Hour, Min and Sec functions to extract each part of the date and time and format according to your requirements. E.g.:

Code: Select all

Year>yyyy
Month>mm
Day>dd
Hour>hh
Min>nn
Sec>ss
Let>FormattedDateTime=%yyyy%-%mm%-%dd% %hh%:%nn%:%ss%
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts