From: bobh on
On Dec 29 2009, 2:51 pm, robboll <robb...(a)hotmail.com> wrote:
> In trying to come up with a VBA timestamp for 2 digit year, month day
> and 24 hr time, I came up with the following code.  IT WORKS!
>
> ? mid(year(date()),3,2) & month(date())&day(date()) & replace
> (FormatDateTime(Now, vbShortTime),":","")
> 0912291327
>
> You can leave off the mid function if you want a full year.  I just
> thought the 2 digit year would suffice.
>
> ? year(date()) & month(date())&day(date()) & replace(FormatDateTime
> (Now, vbShortTime),":","")
> 200912291339
>
> While I was doing this I thought I'd try to scour the net to see if
> there is a cleaner/sweeter way to do it.
>
> Any suggestions out there?
>
> RBollinger

for creating a date/time stamp I use this
MyRec!DTStamp = Format(Date(), "mmddyy") & Format(Time(), "hhnnss")

bobh.
From: Terry Kreft on
format(now, "yymmddhhnnss")

or
format(now, "yymmddhhnn")

if you don't want seconds

--
Terry Kreft


"bobh" <vulcaned(a)yahoo.com> wrote in message
news:7fb8262b-b87d-4094-a45f-0dd1d18573c9(a)21g2000vbh.googlegroups.com...
On Dec 29 2009, 2:51 pm, robboll <robb...(a)hotmail.com> wrote:
> In trying to come up with a VBA timestamp for 2 digit year, month day
> and 24 hr time, I came up with the following code. IT WORKS!
>
> ? mid(year(date()),3,2) & month(date())&day(date()) & replace
> (FormatDateTime(Now, vbShortTime),":","")
> 0912291327
>
> You can leave off the mid function if you want a full year. I just
> thought the 2 digit year would suffice.
>
> ? year(date()) & month(date())&day(date()) & replace(FormatDateTime
> (Now, vbShortTime),":","")
> 200912291339
>
> While I was doing this I thought I'd try to scour the net to see if
> there is a cleaner/sweeter way to do it.
>
> Any suggestions out there?
>
> RBollinger

for creating a date/time stamp I use this
MyRec!DTStamp = Format(Date(), "mmddyy") & Format(Time(), "hhnnss")

bobh.