
このSTR2DT機能ブロックは、英語のテキスト形式で指定された任意の日付を新しい日付に変換します。
入力では、DT#フォーマットの日付と時刻が渡されます。
日付を計算するための文字列を定義します。
この入力は、1970より前の日付を定義できます。そのためには、"12/25/0000"のようなフォーマットを渡す必要があります。これは最初のクリスマスに相当します。その際、最初の数字は12が月で、二番目の25が日です。年を4桁入力する必要があります。そうしないと、2000年の値のみが想定されます。
| 説明 | フォーマット |
|---|---|
| 曜日名 | 'sunday' | 'monday' | 'tuesday' | 'wednesday' | 'thursday' | 'friday' | 'saturday' | 'sun' | 'mon' | 'tue' | 'wed' | 'thu' | 'fri' | 'sat' |
| 平日 | 'weekday' | 'weekdays' |
| 数字 | [+-]?[0-9]+ |
| 序数 | 'first' | 'second' | 'third' | 'fourth' | 'fifth' | 'sixth' | 'seventh' | 'eighth' | 'ninth' | 'tenth' | 'eleventh' | 'twelfth' | 'next' | 'last' | 'previous' | 'this' |
| 相対的なテキスト | 'next' | 'last' | 'previous' | 'this' |
| スペース | [ \t]+ |
| 単位 | (('sec' | 'second' | 'min' | 'minute' | 'hour' | 'day' | 'fortnight' | 'forthnight' | 'month' | 'year') 's'?) | 'weeks' | daytext |
| フォーマット | 説明 | 例 |
|---|---|---|
| 'yesterday' | 昨日の真夜中。 | "yesterday 14:00" |
| 'midnight' | 時刻は00:00:00に設定されます。 | |
| 'today' | 時刻は00:00:00に設定されます。 | |
| 'now' | 無視されます。 | |
| 'noon' | 時刻は12:00:00に設定されます。 | "yesterday noon" |
| 'tomorrow' | 明日の真夜中。 | |
| 'back of' hour | 特定の時刻から15分後。 | "back of 7pm", "back of 15" |
| 'front of' hour | 特定の時刻から15分前。 | "front of 5am", "front of 23" |
| 'first day of' | 現在の月の最初の日を設定します。これは指定された月と年でも機能します。 | "first day of January 2008" |
| 'last day of' | 現在の月の最後の日を設定します。これは指定された月と年でも機能します。 | "last day of next month" |
| ordinal space dayname space 'of' | 月のx番目の曜日を計算します。 | "first sat of July 2008" |
| 'last' space dayname space 'of' | 月の最後の曜日を計算します。 | "last sat of July 2008" |
| number space? (unit | 'week') | 現在の日付からの相対オフセットを計算します。 | "+5 weeks", "12 day", "-7 weekdays" |
| ordinal space unit | 指定された単位に対する相対時間を計算します。 | "fifth day", "second month" |
| 'ago' | 過去の時点を計算します。 | "2 days ago", "8 days ago 14:00", "2 months 5 days ago", "2 months ago 5 days", "2 days ago" |
| dayname | 次の曜日に移動します。 | "Monday" |
| reltext space 'week' | "weekday + last/this/next week"の特別な形式を計算します。 | "Monday next week" |
この出力は、DT#フォーマットの計算された日付と時刻を返します。
エラーが発生した場合、この出力は真になります。