DeveloperBarn Forums

Go Back   DeveloperBarn Forums > Programming & Scripting > ASP Development

Discuss "VBScript Functions Reference" in the ASP Development forum.

ASP Development - Learn coding practices and tips to get the best out of your Active Server Pages (ASP). The Classic ASP forum is for ASP/VBScript and ASP/JScript applications.


Closed Thread « Previous Thread | Next Thread »
 
LinkBack Thread Tools Display Modes
  #21 (permalink)  
Old May 13th, 2008, 08:01 PM
jmurrayhead's Avatar
Your Lord & Master

 
Join Date: Mar 2008
Location: Reston, VA, USA
Posts: 537
Thanks: 14
Thanked 40 Times in 39 Posts
Blog Entries: 2
Rep Power: 1
jmurrayhead will become famous soon enough

Awards Showcase
Microsoft .Net Microsoft SQL Server Microsoft Windows Classic ASP 
Total Awards: 4

Default DatePart

Syntax - DatePart(Interval, Date, FirstDayofWeek, FirstWeekofYear)

Interval - The Interval argument designates the the type of time interval.

Date - The Date argument is the date and time you designate.
FirstDayofWeek - The FirstDayofWeek argument must only use the constants or values defined below in the Date And Time CONSTANTS.
FirstWeekofYear - The FirstWeekofYear argument must only use the constants or values defined in the Date And Time CONSTANTS which are listed above.
The DatePart function returns the designated part of the date.

Possible interval settings:
YYYY -Year
Q - Quarter
M - Month
Y - Day Of Year
D - Day
W - WeekDay
WW - Week Of Year
H - Hour
N - Minute
S - Second

CONSTANT, VALUE, DESCRIPTION
VBSunday, 1, Sunday
VBMonday, 2, Monday
VBTuesday, 3, Tuesday
VBWednesday, 4, Wednesday
VBThursday, 5, Thursday
VBFriday, 6, Friday
VBSaturday, 7, Saturday
VBFirstJan1, 1, Week of January 1
VBFirstFourDays, 2, First week of the year thathas at least four days
VBFirstFullWeek, 3, First full week of the year
VBUseSystem, 0, Use the date format of the computer's regionsl settings
VBUseSystemDayOfWeek, 0, Use the first full day of the week as defined by the system settings

Example(s):

Code:
This will output 5/13/08 13
<% =Date %> 
<% =DatePart("D", Date) %>
 
This will output 7
<% =DatePart("W", 1/1/2000) %>
 
This will output 52
<% =DatePart("WW", "12/31/1999", 1, VBFIRSTFULLWeek) %> 
__________________
jmurrayhead
Did I help you out? Make me popular by clicking the icon!

If you found a post helpful, please click the button in the lower right-hand corner of the post.

Powered by ASP.Net
Sponsored Links
  #22 (permalink)  
Old May 13th, 2008, 08:07 PM
jmurrayhead's Avatar
Your Lord & Master

 
Join Date: Mar 2008
Location: Reston, VA, USA
Posts: 537
Thanks: 14
Thanked 40 Times in 39 Posts
Blog Entries: 2
Rep Power: 1
jmurrayhead will become famous soon enough

Awards Showcase
Microsoft .Net Microsoft SQL Server Microsoft Windows Classic ASP 
Total Awards: 4

Default DateSerial

Syntax - DateSerial(Year, Month, Day)

Year - The Year argument is the year as a string or integer.Month - The Month argument is the month as a string or integer.Day - The Day argument is the Day as a string or integer.
The DateSerial function converts the arguments into the variant of subtype Date.

Example(s):

Code:
This will output 5/13/08
<% =DateSerial(2008, 5, 13) %>
 
This will output 5/13/08
<% =DateSerial("08", "5", "13") %>
  #23 (permalink)  
Old May 13th, 2008, 08:14 PM
jmurrayhead's Avatar
Your Lord & Master

 
Join Date: Mar 2008
Location: Reston, VA, USA
Posts: 537
Thanks: 14
Thanked 40 Times in 39 Posts
Blog Entries: 2
Rep Power: 1
jmurrayhead will become famous soon enough

Awards Showcase
Microsoft .Net Microsoft SQL Server Microsoft Windows Classic ASP 
Total Awards: 4

Default DateValue

Syntax - DateValue(Date)

The DateValue function converts an argument into the variant of subtype Date.

The Date argument must be a string in valid date format or you will get an error message.

Example(s):

Code:
This will output 5/13/2008
<% mystring = "05/13/2008" %> 
<% =DateValue(mystring) %>
 
This will output 3/1/2001
<% =DateValue("3/1/2001") %>
  #24 (permalink)  
Old June 16th, 2008, 10:13 AM
jmurrayhead's Avatar
Your Lord & Master

 
Join Date: Mar 2008
Location: Reston, VA, USA
Posts: 537
Thanks: 14
Thanked 40 Times in 39 Posts
Blog Entries: 2
Rep Power: 1
jmurrayhead will become famous soon enough

Awards Showcase
Microsoft .Net Microsoft SQL Server Microsoft Windows Classic ASP 
Total Awards: 4

Default Day

Syntax - Day(date)

The Day function returns the number of the current day of the month using any valid date expression as an argument.

You can also use the Date and Now functions as the argument.

Example(s):

Code:
'This will output 16
<% =Day(Date) %>
 
'This will ouput 12
<% =Date("5/12/2008") %>
  #25 (permalink)  
Old June 16th, 2008, 10:18 AM
jmurrayhead's Avatar
Your Lord & Master

 
Join Date: Mar 2008
Location: Reston, VA, USA
Posts: 537
Thanks: 14
Thanked 40 Times in 39 Posts
Blog Entries: 2
Rep Power: 1
jmurrayhead will become famous soon enough

Awards Showcase
Microsoft .Net Microsoft SQL Server Microsoft Windows Classic ASP 
Total Awards: 4

Default Eval

Syntax - Eval(Expression)

The Eval function takes a single argument, evaluates it as a VBScript expression, and returns the result of this evaluation.

If the expression is of the form a = b, it is treated as an equality comparison. If the comparison is true, then True is returned. Otherwise, False is returned.

Example(s):
Code:
'This will ouput True
Dim var1, var2
var1 = 5.6
var2 = 5.6
 
Eval("var1 = var2")
Closed Thread

  DeveloperBarn Forums > Programming & Scripting > ASP Development

Bookmarks

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On
Forum Jump


Sponsored Links

ASP.NET Resource Index
a directory of ASP.NET tutorials, applications, scripts, assemblies and articles for the novice to professional developer.

Free Web Directory
Including Chats and Forums Resources, Offer automatic, instant and free directory submissions.
URLZ Web Directory
URLZ Web Directory

Free Web Directory - Add Your Link
The Little Web Directory
Free Web Directory
Pegasus free web directory is a free directory organised by categories.

Web Directory & SEO Services
dirroot web directory


All times are GMT -4. The time now is 08:52 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.2.0
Copyright © 2008 DeveloperBarn.com

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46