Code Comments
Programming Forum and web based access to our favorite programming groups.Hi all: I am trying to create a string using both time and date however I want to do it WITHOUT the punctuation! Example, normally time and date would look like: 23:32:12 11/27/2004 But I want: 23321211272004 as my result. Been working on this one a bit and for some reason my brain is just not functioning right. Any help on this? -- Take it light.... Malakie Malakie@Hotmail.com
Post Follow-up to this message> I am trying to create a string using both time and date however I want to do > it WITHOUT the punctuation! > > Example, normally time and date would look like: 23:32:12 11/27/2004 > > But I want: 23321211272004 as my result. > > Been working on this one a bit and for some reason my brain is just not > functioning right. Any help on this? Try this YourDateVariable = "23:32:12 1/27/2004" CollapsedDate = Format(YourDateVariable, "hhnnssmmddyyyy") Rick - MVP
Post Follow-up to this messageHi all: You know, it is just one of those days.... DUH! Of course after posting my brain had a moment of clarity... I was forgetting to use quotes in the format string! For those who may need this someday as well... Here is what I was doing: format(Time, hhmmss) & format(Date, mmddyyyy) when it should have been: format(Time, "hhmmss") & format(Date, "mmddyyyy") anyhow, back to work.. -- Take it light.... Malakie Malakie@Hotmail.com "Malakie" <Malakie_NOSPAM@NOSPAM_Hotmail.com> wrote in message news:eG$nmx%230EHA.2196@TK2MSFTNGP14.phx.gbl... > Hi all: > > I am trying to create a string using both time and date however I want to > do it WITHOUT the punctuation! > > Example, normally time and date would look like: 23:32:12 11/27/2004 > > But I want: 23321211272004 as my result. > > Been working on this one a bit and for some reason my brain is just not > functioning right. Any help on this? > > -- > Take it light.... > > Malakie > Malakie@Hotmail.com > > >
Post Follow-up to this messageHi Rick: Thanks.. my brain started up again shortly after posting.. I used the long method since I am not having a good day when it comes to thinking... I went with: format(time, "hhmmss") & format(date,"mmddyyyy") Obviously, I am still out of it... I need to change that to your example which is what it should be. *sigh* -- Take it light.... Malakie Malakie@Hotmail.com "Rick Rothstein" <rickNOSPAMnews@NOSPAMcomcast.net> wrote in message news:OMCX04%230EHA.3908@TK2MSFTNGP12.phx.gbl... > to do > not > > Try this > > YourDateVariable = "23:32:12 1/27/2004" > CollapsedDate = Format(YourDateVariable, "hhnnssmmddyyyy") > > Rick - MVP >
Post Follow-up to this messageIf you just want a long hard to understand number to represent a date/time try dim dbl as double,d as date d=now debug.print d dbl=cdbl(d) debug.print dbl debug.print cdate(dbl) "Malakie" <Malakie_NOSPAM@NOSPAM_Hotmail.com> wrote in message news:eG$nmx%230EHA.2196@TK2MSFTNGP14.phx.gbl... > Hi all: > > I am trying to create a string using both time and date however I want to do > it WITHOUT the punctuation! > > Example, normally time and date would look like: 23:32:12 11/27/2004 > > But I want: 23321211272004 as my result. > > Been working on this one a bit and for some reason my brain is just not > functioning right. Any help on this? > > -- > Take it light.... > > Malakie > Malakie@Hotmail.com > > >
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.