Symbian3/PDK/Source/GUID-8538B61F-E4AD-5467-9F9A-EE8EA5008140.dita
author Dominic Pinkman <Dominic.Pinkman@Nokia.com>
Tue, 30 Mar 2010 11:56:28 +0100
changeset 5 f345bda72bc4
parent 3 46218c8b8afa
child 14 578be2adaf3e
permissions -rw-r--r--
Week 12 contribution of PDK documentation_content. See release notes for details. Fixes Bug 2054, Bug 1583, Bug 381, Bug 390, Bug 463, Bug 1897, Bug 344, Bug 1319, Bug 394, Bug 1520, Bug 1522, Bug 1892"

<?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>