Time functions

Results 1 to 2 of 2

Thread: Time functions

  1. #1
    Join Date
    Dec 1969

    Default Time functions

    I was browsing microsofts site and the list of functions. I did not see any like the dateadd() for time. I need to get every half hour from midnight to midnight for a calendar notification. Any way to do this progmattically or would i need to create static times?<BR><BR>Matt

  2. #2
    Steve Cimino Guest

    Default RE: Time functions

    Microsoft® Visual Basic® Scripting Edition<BR>DateAdd Function Language Reference <BR>Version 2 <BR> <BR><BR>See Also <BR><BR><BR>--------------------------------------------------------------------------------<BR><BR>Description<BR>Returns a date to which a specified time interval has been added. <BR>Syntax<BR>DateAdd(interval, number, date)<BR>The DateAdd function syntax has these parts:<BR><BR>Part Description <BR>interval Required. String expression that is the interval you want to add. See Settings section for values. <BR>number Required. Numeric expression that is the number of interval you want to add. The numeric expression can either be positive, for dates in the future, or negative, for dates in the past. <BR>date Required. Variant or literal representing the date to which interval is added. <BR><BR><BR>Settings<BR>The interval argument can have the following values:<BR>Setting Description <BR>yyyy Year <BR>q Quarter <BR>m Month <BR>y Day of year <BR>d Day <BR>w Weekday <BR>ww Week of year <BR>h Hour <BR>n Minute <BR>s Second <BR><BR><BR>Remarks<BR>You can use the DateAdd function to add or subtract a specified time interval from a date. For example, you can use DateAdd to calculate a date 30 days from today or a time 45 minutes from now. To add days to date, you can use Day of Year ("y"), Day ("d"), or Weekday ("w").<BR>The DateAdd function won&#039;t return an invalid date. The following example adds one month to January 31: <BR><BR>NewDate = DateAdd("m", 1, "31-Jan-95")<BR><BR>In this case, DateAdd returns 28-Feb-95, not 31-Feb-95. If date is 31-Jan-96, it returns 29-Feb-96 because 1996 is a leap year.<BR>If the calculated date would precede the year 100, an error occurs.<BR><BR>If number isn&#039;t a Long value, it is rounded to the nearest whole number before being evaluated. <BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts