Symbian3/PDK/Source/GUID-8538B61F-E4AD-5467-9F9A-EE8EA5008140.dita
author Graeme Price <GRAEME.PRICE@NOKIA.COM>
Fri, 15 Oct 2010 14:32:18 +0100
changeset 15 307f4279f433
parent 14 578be2adaf3e
permissions -rw-r--r--
Initial contribution of the Adaptation Documentation.

<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
<!-- This component and the accompanying materials are made available under the terms of the License 
"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:
    Nokia Corporation - initial contribution.
Contributors: 
-->
<!DOCTYPE concept
  PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
<concept id="GUID-8538B61F-E4AD-5467-9F9A-EE8EA5008140" xml:lang="en"><title>How
to format the date and time</title><shortdesc>Format the date with locale-dependent settings, including the date
separator characters, and format date as European, American or Japanese</shortdesc><prolog><metadata><keywords/></metadata></prolog><conbody>
<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
aspects of the time, including the time separator characters, whether a 12
or 24 hour clock is to be used, and whether am/pm text should be located before
or after the time.</p>
<codeblock id="GUID-3EFD2387-3C71-5984-98C5-2C19E50FF88A" xml:space="preserve">TTime homeTime;
TBuf&lt;32&gt; buf;

// get home time and format it locale dependently
homeTime.HomeTime();

_LIT(KFormatTxt,"%/0%1%/1%2%/2%3%/3 %-B%:0%J%:1%T%:2%S%:3%+B");
homeTime.FormatL(buf,KFormatTxt); 

// This gives 19/05/1997 9:44:51 am, assuming 12 hour clock with     
// trailing am/pm text, am/pm space between, and European date format</codeblock>
</conbody></concept>