core/builtins/date.cif
author Tom Sutcliffe <thomas.sutcliffe@accenture.com>
Thu, 26 Aug 2010 00:49:35 +0100
changeset 37 534b01198c2d
parent 7 184a1eb85cf2
child 66 2a78c4ff2eab
permissions -rw-r--r--
Added ENotifyKeypresses and ECaptureCtrlC flags to CCommandBase. Commands can now get keypresses and handle ctrl-C via callbacks instead of having to implement custom active objects. As part of this extended the CCommandBase extension interface to MCommandExtensionsV2 for the new virtual functions KeyPressed(TUint aKeyCode, TUint aModifiers) and CtrlCPressed(). sudo now cleans up correctly by using ECaptureCtrlC.

# date.cif
# 
# Copyright (c) 2010 Accenture. All rights reserved.
# This component and the accompanying materials are made available
# under the terms of the "Eclipse Public License v1.0"
# which accompanies this distribution, and is available
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
# 
# Initial Contributors:
# Accenture - Initial contribution
#

==name date

==short-description

Displays or sets the current time and date.

==long-description

Example usage:

To get the current date and time:

    c:\>date
    07/04/2010 13:46:58.647500

To check how a human readable date is parsed:

    c:\>date --set --just-display "07/04/2010 13:47:00"
    07/04/2010 13:47:00.000000

To convert a raw TInt64 timestamp to a human-readable string:

    c:\>date --raw-set 1234567890 --display-only
    01/01/0000 00:20:34.567890

To set the current local time:

    c:\>date --set "07/04/2010 13:47:00"
    c:\>

To use a timestamp in a filename:

    date --timestamp | export -s TIMESTAMP
    do-something > C:\logs\myoutput-$TIMESTAMP.txt

==option bool u universal

Display or set universal time (UTC) rather than local time.

==option string s set

Sets the time and date. Format is that accepted by TTime::Parse(). For UK English localisations, C<DD/MM/YYYY HH:MM:SS> is one such acceptable format.

==option int o utc-offset

Sets the UTC offset in seconds. Must be used in conjunction with the C<--set> option.

==option bool S secure

Displays or sets the secure variant of the kernel's reckoning of time.

==option bool r raw

Displays the time and date as the number of microseconds since 2000AD (Symbian OS's native time format).

==option bool j just-display

Rather than going ahead and setting the specified time and date, do a dry run and just displays it in human readable form. Must be used in conjunction with C<--set> or <--raw-set>. In effect it is an option to check that the set string has been parsed correctly before actually making the change.

==option int64 R raw-set

Sets the time and date from a number corresponding to the number of microseconds since 2000AD (Symbian OS's native time format).

==option bool t timestamp

Display the date in timestamp format C<YYYYMMDD-HHMM.SS> suitable for use in a file name.

==option bool k kern

Only applicable with C<--raw> and/or C<--raw-set>. Instead of using 2000AD as the epoc, use 0AD nominal Gregorian, the kernel's internal native time format.

==copyright

Copyright (c) 2006-2010 Accenture. All rights reserved.