PDA

View Full Version : [SOLVED] DatePart (Format Standard Date Time)



sheeeng
06-05-2005, 06:57 PM
Hello,

Does anyone know how to use DatePart?
I want to specify a string with date & time format of "yyyy-mm-dd hh:mm".
But I don't want the format to rely on Windows XP Regional Settings & Language Options. I want it to be standard across every computer that uses this Excel Macro.

Please advise.
Thanks.

Leonard :friends:

Killian
06-06-2005, 01:59 AM
I would suggest the Format function is what you want here

strRetDate = Format(Now, "yyyy-mm-dd hh:mm")

sheeeng
06-06-2005, 08:01 AM
Thanks a lot. :clap: (http://www.vbaexpress.com/forum/misc.php?do=getsmilies&wysiwyg=1&forumid=0#)
:friends: (http://www.vbaexpress.com/forum/misc.php?do=getsmilies&wysiwyg=1&forumid=0#)