• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // © 2017 and later: Unicode, Inc. and others.
2 // License & terms of use: http://www.unicode.org/copyright.html
3 /*
4 ******************************************************************************
5 *
6 *   Copyright (C) 2006-2008, International Business Machines
7 *   Corporation and others.  All Rights Reserved.
8 *
9 ******************************************************************************
10 *
11 *  FILE NAME : testTimezone.c
12 *
13 *   Date        Name        Description
14 *   03/02/2006  grhoten/mow Creation.
15 ******************************************************************************
16 */
17 
18 #include "unicode/putil.h"
19 #include "unicode/udat.h"
20 #include <stdio.h>
21 #include <string.h>
22 #include <time.h>
23 
main(int argc,const char * const argv[])24 int main(int argc, const char* const argv[]) {
25     UErrorCode status = U_ZERO_ERROR;
26     char sysTimeStr[256];
27     struct tm summerTimeTM;
28     struct tm winterTimeTM;
29 
30     memset(sysTimeStr, 0, sizeof(sysTimeStr));
31     memset(&summerTimeTM, 0, sizeof(summerTimeTM));
32     memset(&winterTimeTM, 0, sizeof(winterTimeTM));
33 
34     strptime("2006-06-01 12:00", "%Y-%m-%d %H:%M", &summerTimeTM);
35     strftime(sysTimeStr, sizeof(sysTimeStr)-1, "%Y-%m-%d %H:%M", &summerTimeTM);
36     puts(sysTimeStr);
37 }
38