|
1 <?xml version="1.0" encoding="utf-8"?> |
|
2 <!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. --> |
|
3 <!-- This component and the accompanying materials are made available under the terms of the License |
|
4 "Eclipse Public License v1.0" which accompanies this distribution, |
|
5 and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". --> |
|
6 <!-- Initial Contributors: |
|
7 Nokia Corporation - initial contribution. |
|
8 Contributors: |
|
9 --> |
|
10 <!DOCTYPE concept |
|
11 PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd"> |
|
12 <concept id="GUID-8538B61F-E4AD-5467-9F9A-EE8EA5008140" xml:lang="en"><title>How |
|
13 to format the date and time</title><shortdesc>Format the date with locale-dependent settings, including the date |
|
14 separator characters, and format date as European, American or Japanese</shortdesc><prolog><metadata><keywords/></metadata></prolog><conbody> |
|
15 <p>Use <xref href="GUID-A2D3BA72-9B27-3BFF-950A-D7E3B2004821.dita#GUID-A2D3BA72-9B27-3BFF-950A-D7E3B2004821/GUID-9996460E-A3B5-3D48-894F-B67E87098623"><apiname>TTime::FormatL()</apiname></xref> to format the locale-dependent |
|
16 aspects of the time, including the time separator characters, whether a 12 |
|
17 or 24 hour clock is to be used, and whether am/pm text should be located before |
|
18 or after the time.</p> |
|
19 <codeblock id="GUID-3EFD2387-3C71-5984-98C5-2C19E50FF88A" xml:space="preserve">TTime homeTime; |
|
20 TBuf<32> buf; |
|
21 |
|
22 // get home time and format it locale dependently |
|
23 homeTime.HomeTime(); |
|
24 |
|
25 _LIT(KFormatTxt,"%/0%1%/1%2%/2%3%/3 %-B%:0%J%:1%T%:2%S%:3%+B"); |
|
26 homeTime.FormatL(buf,KFormatTxt); |
|
27 |
|
28 // This gives 19/05/1997 9:44:51 am, assuming 12 hour clock with |
|
29 // trailing am/pm text, am/pm space between, and European date format</codeblock> |
|
30 </conbody></concept> |