Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

ASP.NET Forum


You are currently viewing our ASP.NET Forum as a guest. Please register to participate.
Login



Closed Thread
Formating dates in classic asp
Old 04-06-2010, 07:22 PM Formating dates in classic asp
sandbox's Avatar
Extreme Talker

Posts: 153
Trades: 0
I'm having a bit of trouble getting my head round date formatting in asp, my current date displays like this: 05/04/2010 21:03:14 using this code response.write("" & rs("my_date")) Does anyone know how i can format the date to show just the month, year or day. Something like this: 5th april 2010

I've dug up some code on the web that can display todays date but I can't apply this formatting to my date displayed from a database. looks like this: Response.write FormatDateTime(todaysDate,1)
__________________
¦
Please login or register to view this content. Registration is FREE
s ¦
Please login or register to view this content. Registration is FREE
¦
Please login or register to view this content. Registration is FREE
sandbox is offline
View Public Profile Visit sandbox's homepage!
 
 
Register now for full access!
Old 04-08-2010, 06:42 AM Re: Formating dates in classic asp
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,336
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
use the vbShortDate constant (2)

http://www.w3schools.com/vbScript/fu...atdatetime.asp
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
View Public Profile Visit chrishirst's homepage!
 
Old 04-08-2010, 08:34 PM Re: Formating dates in classic asp
sandbox's Avatar
Extreme Talker

Posts: 153
Trades: 0
Thanks Chris, I tried that and it shows saturday, December 30, 1899 I was wanting to make one of those date icons that some blogs have, I think I need to break the date down and display it in separate Divs. My first step is to format the output of my database, my code looks like this: response.write("" & rs("my_date")) anyone know what I should change this to, to get just the month.
__________________
¦
Please login or register to view this content. Registration is FREE
s ¦
Please login or register to view this content. Registration is FREE
¦
Please login or register to view this content. Registration is FREE
sandbox is offline
View Public Profile Visit sandbox's homepage!
 
Old 04-10-2010, 08:05 AM Re: Formating dates in classic asp
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,336
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Day(date())
Month(date())
Year(date())

http://www.w3schools.com/vbscript/vb..._functions.asp
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
View Public Profile Visit chrishirst's homepage!
 
Old 04-10-2010, 07:20 PM Re: Formating dates in classic asp
Super Talker

Posts: 143
Trades: 0
Yeah this tutorial can resolve your problem.
itbuzz is offline
View Public Profile
 
Old 04-12-2010, 07:13 PM Re: Formating dates in classic asp
sandbox's Avatar
Extreme Talker

Posts: 153
Trades: 0
Thanks guys, I've got it now.
All date formatting problems solved, Cheers
__________________
¦
Please login or register to view this content. Registration is FREE
s ¦
Please login or register to view this content. Registration is FREE
¦
Please login or register to view this content. Registration is FREE
sandbox is offline
View Public Profile Visit sandbox's homepage!
 
Closed Thread     « Reply to Formating dates in classic asp
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.68577 seconds with 12 queries