Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 30th, 2003, 11:55 AM
Registered User
 
Join Date: Sep 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default ASP Date Function

I was wondering, is there a function that out puts the day, month and year separately? For example if I wanted to get only the month and store it in a db which function can I use to do so.

Thanks for your assistance in this matter,
Ken

 
Old September 30th, 2003, 12:04 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 141
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Code:
Month(Now)
will give you the number of the month. For example December will return 12.
Code:
Day(Now)
will give you the day number.
Code:
Year(Now)
will give you the year.
Code:
MonthName(Month(Now))
will give you the name of the month.
Code:
Hour(Now), Minute(Now), Second(Now)
all return their respective data.
Code:
Week(now)
returns the week number.
Code:
WeekDay(Now)
returns the week day number (Sunday = 1, Monday = 2, etc.).
Code:
WeekDayName(WeekDay(Now))
Returns the name of the weekday (Sunday, Monday, etc.).

Now just returns the current time and date. Date could also be used for the date functions as well as any date in string or datetime format. (i.e. day('1/3/03'))

That is all I can think of right off the top of my head, but I am sure there are at least a few more.


Chris
 
Old September 30th, 2003, 01:07 PM
Registered User
 
Join Date: Sep 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you so very much Chris. I appreciate your help immensely.

Kindest Regards,
Ken


 
Old September 30th, 2003, 02:04 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 141
Thanks: 0
Thanked 0 Times in 0 Posts
Default

not a problem - glad I could be of help.

Chris





Similar Threads
Thread Thread Starter Forum Replies Last Post
Date Function desireemm SQL Language 1 March 26th, 2007 04:28 AM
ASP Date Function cancer10 Classic ASP Databases 3 January 5th, 2007 06:35 PM
between date function surendran SQL Server 2000 2 October 19th, 2006 09:31 PM
Date Function problem beetle_jaipur Classic ASP Basics 5 July 6th, 2006 01:08 PM
Passing Date, String values in ASP Function. rupen Classic ASP Basics 2 July 6th, 2005 09:42 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.