|
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-61376760-C576-51E0-85F2-34718F8DC321" xml:lang="en"><title>Using |
|
13 TDateTime</title><shortdesc>Explains how to set Date and Time.</shortdesc><prolog><metadata><keywords/></metadata></prolog><conbody> |
|
14 <section id="GUID-151083D6-2636-4AD7-8C6F-581C8E2973F5"><title>TDateTime()</title> <p>The example below shows how to construct |
|
15 a <codeph>TDateTime</codeph> object, initialising it to midnight 6th January |
|
16 1996;</p> <codeblock id="GUID-7AF7F876-0F7B-53BE-8C6C-D4969A0D51A7" xml:space="preserve">TDateTime dateTime(1996,EJanuary,5,00,00,00,000000);</codeblock> </section> |
|
17 <section id="GUID-640A9BD8-6C78-49BB-A62F-AC43382835CF"><title>Set()</title> <p>When setting the day and month, subtract |
|
18 one because the ranges are offset from zero. For example, to set the date |
|
19 to 31st December 1996:</p> <codeblock id="GUID-323B8F7F-A503-5E6A-B638-1092C948F4DE" xml:space="preserve">TDateTime dateTime; |
|
20 TInt year=1996, month=12, day=31; |
|
21 dateTime.Set(year,TMonth(month-1),day-1,0,0,0,0);</codeblock> </section> |
|
22 </conbody></concept> |