date/time helper utility

E

Eman

Hello, everybody.

Since questions about date and time in batch scripts
appear to be regular in the newsgroups, i've created a tiny
console utility just for that purpose. I've named it HLDate.
It's freeware. I hope it could help someone.

All what it does is, it outputs formatted date and/or time
to the stdout. You can use any custom date-time format
specification. The program can output current date-time or
a specified date-time value. There are also other features.

You can download it from
http://www.filefactory.com/file/b2c87b/ or
http://flyfolder.ifolder.ru/314984

This temporary links would be valid about a month. If someone
holds a web or ftp for such kind of stuff, i'd appreciate
if you include this one in the collection of your downloads.

HLDate is designed to operate under Windows NT platform only.
That means you can run it under Windows NT / 2000 / XP / ..
but you can't run it on Windows 95 / 98, or Windows Me.
 
J

Jerold Schulman

Hello, everybody.

Since questions about date and time in batch scripts
appear to be regular in the newsgroups, i've created a tiny
console utility just for that purpose. I've named it HLDate.
It's freeware. I hope it could help someone.

All what it does is, it outputs formatted date and/or time
to the stdout. You can use any custom date-time format
specification. The program can output current date-time or
a specified date-time value. There are also other features.

You can download it from
http://www.filefactory.com/file/b2c87b/ or
http://flyfolder.ifolder.ru/314984

This temporary links would be valid about a month. If someone
holds a web or ftp for such kind of stuff, i'd appreciate
if you include this one in the collection of your downloads.

HLDate is designed to operate under Windows NT platform only.
That means you can run it under Windows NT / 2000 / XP / ..
but you can't run it on Windows 95 / 98, or Windows Me.


There is no download button or link at http://www.filefactory.com/file/b2c87b/

Jerold Schulman
Windows Server MVP
JSI, Inc.
http://www.jsiinc.com
http://www.jsifaq.com
 
J

J R Stockton

Hello, everybody.

Since questions about date and time in batch scripts
appear to be regular in the newsgroups, i've created a tiny
console utility just for that purpose. I've named it HLDate.
It's freeware. I hope it could help someone.

All what it does is, it outputs formatted date and/or time
to the stdout. You can use any custom date-time format specification.

Does that include ISO 8601 yyyy-ww-d format, used in
standards-respecting countries?
The program can output current date-time or a specified date-time
value. There are also other features.

You can download it from http://www.filefactory.com/file/b2c87b/ or
http://flyfolder.ifolder.ru/314984

This temporary links would be valid about a month. If someone
holds a web or ftp for such kind of stuff, i'd appreciate
if you include this one in the collection of your downloads.

HLDate is designed to operate under Windows NT platform only.
That means you can run it under Windows NT / 2000 / XP / ..
but you can't run it on Windows 95 / 98, or Windows Me.

NOWMINUS, via sig line 3, can also be run in those earlier Windows, and
in real DOS. In systems previous to those in which yours runs, it can
write to the Environment as well as to StdOut. It only gives reasonable
formats.
 
J

J R Stockton

This is just a command-line interface to OLEAUT32.VarFormat (RTFM).

In that case, it may use the same algorithm as VBscript in
W = DatePart("ww", CDate("Dec 29 2003"), vbMonday, vbFirstFourDays)
which gives the Week Number correctly for most dates but fails for three
dates in every 28 years currently - both in IE4 from Win98 1st Edn and
IE6 from WinXP sp2, also with command-line CSCRIPT.

It's not clear to me what DatePart("ww", ...) is really intended to
give.

The "non-ISO" nature of the result is clear because each of those three
Mondays gives a result of 53 but the following day gives 1; ISO Week
Numbers change only between Sun & Mon.

<URL:http://www.merlyn.demon.co.uk/vb-date2.htm#WN> tests DatePart.
See <URL:http://www.merlyn.demon.co.uk/weekinfo.htm> etc.

Correct efficient algorithms are in vb-date2.htm.

A complete ISO Week Number algorithm will return Year, Week, and Day
numbers (from YMD or other Date), and there should be a matching reverse
function.
I will route your question about standards-respecting countries to
Microsoft.

It's a good idea to read the newsgroup and its FAQ. See below.
 
E

Eman

J R Stockton said:
In that case, it may use the same algorithm as VBscript in
W = DatePart("ww", CDate("Dec 29 2003"), vbMonday, vbFirstFourDays)

Most probably "yes", and the Format(#12/29/2003#, "ww", ..)
gives the same too.
which gives the Week Number correctly for most dates but fails for three dates
in every 28 years currently - both in IE4 from Win98 1st Edn and IE6 from
WinXP sp2, also with command-line CSCRIPT.

It's not clear to me what DatePart("ww", ...) is really intended to give.

The "non-ISO" nature of the result is clear because each of those three
Mondays gives a result of 53 but the following day gives 1; ISO Week Numbers
change only between Sun & Mon.

<URL:http://www.merlyn.demon.co.uk/vb-date2.htm#WN> tests DatePart.
See <URL:http://www.merlyn.demon.co.uk/weekinfo.htm> etc.

Correct efficient algorithms are in vb-date2.htm.

A complete ISO Week Number algorithm will return Year, Week, and Day numbers
(from YMD or other Date), and there should be a matching reverse function.

Oh, i see.. I should say, i had no intention to *implement* a
calendar algorithm(s). If there is something wrong with Microsoft
API i suppose they must correct it in the future, maybe you should
report them a bug. My own motive to create this HLDate utility
was just to provide a *simple* handy command-line interface to
*built-in* Windows' functionality. I consider that as a merit due
to understandable reason: the result could be easily related to
current system/user locale settings (or, could not, that is user'
choice). So, that is supposed to be an easy user-friendly tool
for solving common date-time issues in an ordinary batch works
on WinNT.
 
E

Eman

Hello, everybody.

Value of some date / time is often used in WinNT batch
scripting typically to create a names of log files,
backup archives, and likewise. There are standard Windows
commands, such as "date" and "time" but their output is
locale dependent so that it's difficult to create
universal batch-scripting solutions. This freeware utility
will give you a way to do that with simple user friendly
commandline interface.

In new version, some inconsistencies in documentation
and help screen text were corrected, also license was
changed (you can distribute the executable along with
your own scripting solution).

Download URL:
http://www.verzend.be/v/7815030/HLDate.1.0.1.zip.html

Also you can download HLDate from:
http://www.jsifaq.com/SF/Tips/Tip.aspx?id=10932
 
E

Eman

Hello, everybody.

HLDate new version (1.0.2) has some major additions.
Now it can output not only current date-time or some
given date-time value but also filetime of given file
or folder, or last write time of a registry key, or
just a given count of seconds, minutes, hours, or days.
As an alternative to formatted output it can now output
the date-time value as an integer number representing
time interval in seconds, minutes, hours, or days.

HLDate is freeware and its executable can be
redistributed along with your own scripting solution.

Thank you for your attention.

Download URL (40Kb):
http://www.verzend.be/v/8676019/HLDate_1.0.2.zip.html

Also you can download HLDate from:
http://www.jsifaq.com/SF/Tips/Tip.aspx?id=10932

~~
HLDate [formatstring|/Tx] [/U] [/FD:value] [/FW:value] [/L:value]
[/D:value|/J:value|/Ax:value|/Nx:file|/K:regkey] [/R] [/HIJRI]

formatstr - Common VBA syntax. Examples: "d, dddd - hh:nn", "0.000000"
/U(tc) - Returns UTC instead of local time (ignored with /D, /J,or /Ax)
/FD:value - First-day-of-week mode (0 - system default, 1 - 7)
/FW:value - First-week-of-year mode (0 - system default, 1 - 3)
/D:value - Accepts given date to be formatted instead of current date
Example: /D:"2005-04-03 02:01"
/J:value - Accepts given date as a "Julian day". Example: /J:38445.08403
/Nx:file - Returns file or directory time (use /NM, /NC, or /NA)
/K:regkey - Returns registry key last write time ("[\\Host\]Hive\Path")
/Tx - Returns interval since 1980-01-01 (use /TD, /TH, /TN, /TS)
/Ax:value - Accepts interval since 1980-01-01 (use /AD, /AH, /AN, /AS)
/L:value - Formats and recognizes date according to LocaleID specified.
/R - Tries to recognize input in alt. locale (for /D, /J, or /Ax)
/HIJRI - Alternates calendar
/EM:anytext - Accepts error mark string
~~

Eman said:
Hello, everybody.

Value of some date / time is often used in WinNT batch
scripting typically to create a names of log files,
backup archives, and likewise. There are standard Windows
commands, such as "date" and "time" but their output is
locale dependent so that it's difficult to create
universal batch-scripting solutions. This freeware utility
will give you a way to do that with simple user friendly
commandline interface.
[..]

Eman said:
Hello, everybody.

Since questions about date and time in batch scripts
appear to be regular in the newsgroups, i've created a tiny
console utility just for that purpose. I've named it HLDate.
It's freeware. I hope it could help someone.

All what it does is, it outputs formatted date and/or time
to the stdout. You can use any custom date-time format specification. The
program can output current date-time or a specified date-time value.
There are also other features.
[..]

HLDate is designed to operate under Windows NT platform only.
That means you can run it under Windows NT / 2000 / XP / ..
but you can't run it on Windows 95 / 98, or Windows Me.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top