Note: This website is archived. For up-to-date information about D projects and development, please visit wiki.dlang.org.

Changes between Version 1 and Version 2 of StdLib/OSLib

Show
Ignore:
Author:
JarrettBillingsley (IP: 71.199.122.84)
Timestamp:
04/27/08 16:38:46 (16 years ago)
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • StdLib/OSLib

    v1 v2  
    3434The default is `"G"`, which shows the date and time. 
    3535 
    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.   
    3737 
    3838`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()`).   
    4040Because 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.   
    4141 
    42 == '''`os.dateTime([output])`''' == 
     42== '''`os.dateTime([useGMT = false], [output]])`''' == 
    4343 
    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. 
     44Puts 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 
     46If 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. 
    4547 
    4648== '''`os.culture([new])`''' ==