Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 19th, 2005, 11:39 AM
Bill
Guest
 
Posts: n/a
Default Formatting date

I'm currently entering the date into my date field using the now()
function, which delivers this result: 2/2/2004 9:08:09 AM which is
fine for some cases.

However, when retreiving this result, sometimes I'd just like to pull
up the first part, such as the 2/2/2004 and cut out the rest. How do
I take this date output, and format it to show only what I want? I'm
writing all this in ASP.

Thanks,

Bill
  #2  
Old July 19th, 2005, 11:39 AM
Ray at
Guest
 
Posts: n/a
Default Re: Formatting date

Take a look at the formatDateTime function in your VBScript documentation
that you downloaded from here.
http://www.microsoft.com/downloads/d...6-1C4099D7BBB9

Ray at work

"Bill" <billzimmerman@gospellight.com> wrote in message
news:8da5f4f4.0402030817.65ee9deb@posting.google.c om...[color=blue]
> I'm currently entering the date into my date field using the now()
> function, which delivers this result: 2/2/2004 9:08:09 AM which is
> fine for some cases.
>
> However, when retreiving this result, sometimes I'd just like to pull
> up the first part, such as the 2/2/2004 and cut out the rest. How do
> I take this date output, and format it to show only what I want? I'm
> writing all this in ASP.
>
> Thanks,
>
> Bill[/color]


  #3  
Old July 19th, 2005, 11:39 AM
Peter Foti
Guest
 
Posts: n/a
Default Re: Formatting date

"Bill" <billzimmerman@gospellight.com> wrote in message
news:8da5f4f4.0402030817.65ee9deb@posting.google.c om...[color=blue]
> I'm currently entering the date into my date field using the now()
> function, which delivers this result: 2/2/2004 9:08:09 AM which is
> fine for some cases.
>
> However, when retreiving this result, sometimes I'd just like to pull
> up the first part, such as the 2/2/2004 and cut out the rest. How do
> I take this date output, and format it to show only what I want? I'm
> writing all this in ASP.[/color]

The FormatDateTime function will do what you want. For example:

Response.Write FormatDateTime( Now(), VBShortDate )

Hope this helps.
Regards,
Peter Foti


 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles