Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Formatting time and date strings...
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




Report this thread to moderator Post Follow-up to this message
Old Post
Malakie
11-26-04 08:55 PM


Re: Formatting time and date strings...
> 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


Report this thread to moderator Post Follow-up to this message
Old Post
Rick Rothstein
11-26-04 08:55 PM


Re: Formatting time and date strings...
Hi 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
>
>
>



Report this thread to moderator Post Follow-up to this message
Old Post
Malakie
11-26-04 08:55 PM


Re: Formatting time and date strings...
Hi 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
>



Report this thread to moderator Post Follow-up to this message
Old Post
Malakie
11-26-04 08:55 PM


Re: Formatting time and date strings...
If 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
>
>
>



Report this thread to moderator Post Follow-up to this message
Old Post
Norm Cook
11-27-04 08:55 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

MSDN archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 06:56 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.