Login | |
|
 |
Help formatting date and time - 2/19/2008 12:58:13 PM
|
|
 |
|
| |
kenm
Posts: 4
Score: 0
Joined: 2/19/2008
Status: offline
|
Hello all, I'm writing a function to output the current time and date, and I'm trying to display the month, day, year,... hour, minute, and second in a 2-digit format without any dashes or slashes, so it should always display twelve character (ex: 021908083830). I've found a selection of characters that will achieve the 2-digit format (ex: %m for 2 digit month, %y for 2-digit year, etc...), but I can't figure out the proper way to include them in my code. I've included the code I already have. Any ideas? Thanks in advance -Kenm Function GetUniqueId Dim strDateTime strDateTime = FormatDateTime(now(), vbGeneralDate) strDateTime = Replace(strDateTime, "/", "", 1, Len (strDateTime), 1) strDateTime = Replace(strDateTime, ":", "", 1, Len (strDateTime), 1) strDateTime = Replace(strDateTime, " ", "", 1, Len (strDateTime), 1) GetUniqueId = strDateTime End Function
|
|
| |
|
|
|
|
|