Milisecond in Time Stamp

  • Thread starter Thread starter Ken
  • Start date Start date
K

Ken

Hello

Can you tell me what to use to include miliseconds for a
16-digit time stamp? The format I am using is

yyyymmddhhnnss

This is 14 digits and I need two additional digits.

Any help is greatly appreciated.

Thank you
Ken
 
The Date/Time data type in VBA isn't capable of storing milliseconds
accurately, and even if it could, you can't display it. It's an 8 byte
floating point number, where the integer part represents date as the number
of days relative to 30 Dec, 1899, and the decimal part represents time as a
fraction of a day. Due to how large the date values are, the precision of
the time isn't going to be much better than 3 or 4 milliseconds.

If you really need the milliseconds, you're better off storing the timestamp
using some other approach.
 
I am in need of only two digits of milisecond. I am not
really concerned with accuracy. The reason I am needing
millisecond is for naming files that will be dumped into
an imaging folder automatically. The program that is set
up to read the file is looking for a file name with a 16
digit time stamp. What is your suggestion for being able
to use two milisecond digits in this fasion?

Thank you
Ken
 
Realistically, you can't with the Date/Time data type: there's no way to
format the milliseconds. Two options that come to mind are:

1) Use the 14 digit stamp you get with the Date/Time data type, and add 2
digits after. If you've got 20030826173700, make the first file
2003082617370001, the next one 2003082617370002, then 2003082617370003 and
so on.

2) Take a look at one solution Joe Foster posted about a year and a half
ago.
http://groups.google.com/groups?selm=eIFcts0qBHA.2080@tkmsftngp03
 
Back
Top