 |
| |
| Overview |
| |
All date-oriented commands that involve calculations (e.g.AddDays and AddWeekDays)are limited to the years 1900 to 2999.These commands normally expect to see the year expressed with four digits (e.g.2009), but if you pass them a two-digit year they will try to guess the appropriate millennium.That is to say,if the two digits are in the range 80 to 99,the year will be taken to mean 1980 to 1999.
When using commands that handle date and time,you should be careful that you are specifying valid values. For example,if you set the hour to 999 the program will terminate with an explanatory error message. |
| |
| DateTimeFormat |
| |
| Format |
v1 =DateTimeFormat v2 v3 v4 v5 v6 v7 v8 |
| Examples |
DateTime =DateTimeFormat 2008 12 25 17 29 30 'Y-?N-?D H:?I?S'
DateOnly =DateTimeFormat 2009 12 25 '''''''Y-?N-?D'
TimeOnly =DateTimeFormat ''''''17 29 '''?h:?I a' |
| Purpose |
Formats a date or time,or both,into a text string |
| Parameters |
v1 =Variable being set
v2 to v4 =Year,Month,Day (all may be set to null if not used)
v5 to v6 =Hour (24-hour),Minute,Second (all may be set to null)
v8 =Date and time format codes (explained below) |
| Controls |
See “Date and Time Format Codes ” |
|
| |
| Date and Time Format Codes |
| |
—————
Codes
————— |
——————————————————————————————————————————————————————————————————————
Explanations
—————————————————————————————————————————————————————————————————————— |
| ? |
Padding position to prefix a zero to a single-digit value |
| a |
Ante Meridiem or Post Meridiem,in lowercase:am or pm |
| A |
Ante Meridiem or Post Meridiem,in uppercase:AM or PM |
| D |
Day of the month |
| h |
Hour of the day (12-hour clock) |
| H |
Hour of the day (24-hour clock) |
| I |
Minute of the hour |
| m |
Month of the year (three letters,capitalized) |
| M |
Month of the year (three letters,uppercase) |
| N |
Month of the year (numeric) |
| S |
Second of the minute (numeric) |
| t |
Month of the year (full name,capitalized) |
| T |
Month of the year (full name,uppercase) |
| Y |
Four-digit year (if input is two digits,80 to 99 yield 1980 to 1999) |
| y |
Two-digit year (if input is four digits,first two digits are dropped) |
| ————— |
—————————————————————————————————————————————————————————————————————— |
|
| |
| Examples |
| |
——————————————————————
Sample Format Settings
—————————————————————— |
——————————————————————
Sample Results
—————————————————————— |
———————————————————————————
Comments
——————————————————————————— |
| 'M ?D ?y' |
JAN 12 09 |
|
| 'm ?D ''?y ?H:?I:?S a' |
Feb 22 '09 04:01:2 am |
|
| 't D,Y,H:?I A' |
July 4,1981,2:01 PM |
|
| 't D,Y,?H:?I:?S' |
May 4,1981,14:01:02 |
|
| '?D/?N/?y' |
01/02/03 |
European date format |
| '?N/?D/?y' |
02/01/03 |
Date format in USA |
| 'Y-?N-?D' |
2003-02-01 |
IS0 8601 international date |
| ————— |
—————————————————————— |
——————————————————————————— |
|
| |
| AddDays |
| |
| Format |
AddDays v1 v2 v3 v4 |
| Examples |
AddDays MyYear MyMonth MyDay 14 |
| Purpose |
Adds the specified number of days to the specified date |
| Parameters |
v1 to v3 =Year,Month and Day (these must be variables)
v4 =Number of days to add (if negative,days are subtracted) |
| Similar Cmds |
AddWeekDays |
| Notes |
Please see the “Overview ” section for more information about
working with date data.
If v4 =0 then the date is not changed. |
|
| |
| AddWeekDays |
| |
| Format |
AddWeekDays v1 v2 v3 v4 [t5 ] |
| Examples |
AddWeekDays MyYYYY MyMM MyDD 23 'MyHolidays' |
| Purpose |
Adds the specified number of weekdays to the specified date,
optionally skipping holidays as well (if t5 is specified) |
| Parameters |
v1 to v3 =Year,Month and Day (these must be variables)
v4 =Number of days to add (if negative,weekdays are subtracted)
t5 =Table name defined by the LookupFile command |
| Defaults |
If t5 is not specified,AddWeekDays will skip only Saturdays and Sundays. |
| Restrictions |
If a holiday is not listed in the table specified by t5,
AddWeekDays does not know about it. |
| Similar Cmds |
AddDays |
| Notes |
Please see the “Overview ” section for more information about
working with date data.
If v4 =0 then the date is moved forward to the next day that
is considered a weekday (i.e.holidays are also skipped). |
|
| |
| Two sample lookup files for holidays are available from Pyroto,Inc.(these are included in the standard installation package for the Parse-O-Matic Power Tool).The files are: |
LufHolidaysCanada.txt
LufHolidaysUSA.txt |
| These list the holidays for Canada and the USA.The Canadian file contains extensive notes on calculating and adding new holidays,and also explains how you can create a custom holiday file. |
| We strongly recommend reviewing a holiday lookup file before using it.Some holidays that are included in the files mentioned above are “commented out ” because they are not celebrated nationally..You can edit a copy of the file (and give it a different name)by using a text editor such as Windows Notepad. |
| Note:If you create a lookup file for holidays in a country other than the ones we have included,we would be most appreciative if you would send us a copy. |
| |
| DayOfTheWeek |
| |
| Format |
v1 =DayOfTheWeek v2 v3 v4 [v5 ] |
| Examples |
DayName =DayOfTheWeek 2010 12 25 '/Sun/Mon/Tue/Wed/Thu/Fri/Sat' |
| Purpose |
Sets v1 to the name of the day of the week |
| Parameters |
v1 =Variable being set
v2 to v4 =Year,Month,Day
v5 =List of day names |
| Defaults |
v5 ='/1/2/3/4/5/6/7'(1 =Sunday) |
| Notes |
Please see the “Overview ” section for more information about
working with date data. |
|
| If you specify the names of the days of the week (v5),you must list all 7 days (starting with Sunday).The first character in the list is taken as the delimiter.The usual choice is the slash character,but a different character could be used,as long as it does not appear in any of the day names. |
| |
| Now |
| |
| Format |
v1 =Now [v2 ] |
| Examples |
MyDateTime =Now 'Y-?N-?D H:?I?S' |
| Purpose |
Sets v1 to the current date,or time,or both |
| Parameters |
v1 =Variable being set
v2 =Date and time format codes (see “DateTimeFormat ”) |
| Defaults |
v2 ='Y/?N/?D'(e.g.2010/12/25) |
| Similar Cmds |
DateTimeFormat |
| Notes |
Please see the “Overview ” section for more information about
working with date data. |
(This page is part of the
online user manual for Parse-O-Matic. Parse-O-Matic is a
programmable parsing tool that can extract, manipulate, convert or mine
existing data sources and turn them into importable data. For more
information on Parse-O-Matic products and conversion services, please
visit www.ParseOMatic.com) |
| |