Re: Using time conditions in vbs?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Chip Orange wrote on 18 dec 2008 in microsoft.public.scripting.vbscript:

I too need to understand time and it's possibilities in VBScript. Is
it possible to do date/time arithmetic in VBScript? I need to take
the difference between 2 times and come up with the number of seconds
that have passed, is this possible?

DateDiff(interval, date1, date2 [,firstdayofweek[, firstweekofyear]])


Arguments
interval
Required. String expression that is the interval you want to use to
calculate the differences between date1 and date2. See Settings section
for values.

date1, date2
Required. Date expressions. Two dates you want to use in the calculation.

firstdayofweek
Optional. Constant that specifies the day of the week. If not specified,
Sunday is assumed. See Settings section for values.

firstweekofyear
Optional. Constant that specifies the first week of the year. If not
specified, the first week is assumed to be the week in which January 1
occurs. See Settings section for values.

Settings
The interval argument can have the following values:

Setting Description
yyyy
Year

q
Quarter

m
Month

y
Day of year

d
Day

w
Weekday

ww
Week of year

h
Hour

n
Minute

s
Second



--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
.



Relevant Pages

  • Re: Display problem
    ... [[Specifies whether you want Internet Explorer to always use the color ... Web page chooses different colors for text and background, the settings you ... Ignore font styles specified on Web pages ...
    (microsoft.public.windowsxp.general)
  • Re: COPTFLAGS (not?) only for compiling the kernel?
    ... >> world or port builds, ... specifies the default settings for all the available options. ... -O overriding -O2 when compiling a port... ...
    (freebsd-questions)
  • where has /etc/defaults/make.conf gone? [was: COPTFLAGS...]
    ... >> which specifies the default settings for all the available options. ... >> administrator wishes to override these defaults. ... > CFLAGS are considered BROKEN and ought to be fixed... ...
    (freebsd-questions)
  • Re: Local Security Policy vs Security Config & Analysis
    ... Keep in mind that not all your settings are defined by the local policy... ... > What I want is a template of the security settings as defined in the Local ... >> Specifies the database used to configure security. ... >> Merges and exports domain and local policy security settings. ...
    (microsoft.public.security)
  • Re: DateDiff funtion - what is interval?
    ... functions/Date/time functions: ... DateDiff(interval, date1, date2]) ... a constant that specifies the first week of the ... The key thing here is where it says "string expression" ...
    (microsoft.public.project)