Changes between Version 1 and Version 2 of StdLib/OSLib
- Timestamp:
- 04/27/08 16:38:46 (16 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
StdLib/OSLib
v1 v2 34 34 The default is `"G"`, which shows the date and time. 35 35 36 `time` defaults to 'null', which makes it format the current time. Otherwise, you should pass a table. The table must have '`year`', '`month`', and '`day`' fields, all integers. It can optionally have '`hour`' (interpreted as a 24-hour hour, so 8 PM is hour 20), '`min`', and '`sec`' fields, also all integers. If you want the time, you must provide all three fields, or else they will be ignored.36 `time` defaults to 'null', which makes it format the current time. If you use the `"R"` format and leave out the time, it uses GMT; otherwise it uses the current local time. If you do pass a time to this parameter, you should pass a table. The table must have '`year`', '`month`', and '`day`' fields, all integers. It can optionally have '`hour`' (interpreted as a 24-hour hour, so 8 PM is hour 20), '`min`', and '`sec`' fields, also all integers. If you want the time, you must provide all three fields, or else they will be ignored. 37 37 38 38 `culture` is optional. It should be a string in the "`<language>-<REGION>`" form used by Tango's underlying Culture class (examples: "en-US" for English, US. "ja-JP" for Japanese. "fr-FR" for French in France.). If you don't pass a culture, the date will be formatted according to the current culture's rules (usually determined automatically by Tango, but you can change it with `os.culture()`). 40 40 Because all parameters are optional, calling `os.dateString()` will yield a reasonable string representation of the current date and time formatted according to the current culture's rules. 41 41 42 == '''`os.dateTime([ output])`''' ==42 == '''`os.dateTime([useGMT = false], [output]])`''' == 43 43 44 Puts the current date and time into a table. If you pass nothing, the date and time are placed into a new table and returned. If you pass something for the `output` parameter, it must be a table. It will have its '`year`', '`month`', '`day`', '`hour`', '`min`', and '`sec`' fields set to the current time, using opIndexAssign metamethods if necessary. The return value will then become the table that you passed in. The option to pass in a table to take the output is to make it faster if you need to keep getting the time over and over, instead of requiring a heap allocation each time. 44 Puts the current date and time into a table. The first parameter is optional and is a boolean indicating whether to get GMT (if you pass true), or if it should get the current local time (the default). 45 46 If you pass nothing for the `output` parameter, the date and time are placed into a new table and returned. If you pass something for the `output` parameter, it must be a table. It will have its '`year`', '`month`', '`day`', '`hour`', '`min`', and '`sec`' fields set to the current time, using opIndexAssign metamethods if necessary. The return value will then become the table that you passed in. The option to pass in a table to take the output is to make it faster if you need to keep getting the time over and over, instead of requiring a heap allocation each time. 45 47 46 48 == '''`os.culture([new])`''' ==