12e5b6d6dSopenharmony_ci// © 2017 and later: Unicode, Inc. and others. 22e5b6d6dSopenharmony_ci// License & terms of use: http://www.unicode.org/copyright.html 32e5b6d6dSopenharmony_ci/* 42e5b6d6dSopenharmony_ci****************************************************************************** 52e5b6d6dSopenharmony_ci* 62e5b6d6dSopenharmony_ci* Copyright (C) 2006-2008, International Business Machines 72e5b6d6dSopenharmony_ci* Corporation and others. All Rights Reserved. 82e5b6d6dSopenharmony_ci* 92e5b6d6dSopenharmony_ci****************************************************************************** 102e5b6d6dSopenharmony_ci* 112e5b6d6dSopenharmony_ci* FILE NAME : testTimezone.c 122e5b6d6dSopenharmony_ci* 132e5b6d6dSopenharmony_ci* Date Name Description 142e5b6d6dSopenharmony_ci* 03/02/2006 grhoten/mow Creation. 152e5b6d6dSopenharmony_ci****************************************************************************** 162e5b6d6dSopenharmony_ci*/ 172e5b6d6dSopenharmony_ci 182e5b6d6dSopenharmony_ci#include "unicode/putil.h" 192e5b6d6dSopenharmony_ci#include "unicode/udat.h" 202e5b6d6dSopenharmony_ci#include <stdio.h> 212e5b6d6dSopenharmony_ci#include <string.h> 222e5b6d6dSopenharmony_ci#include <time.h> 232e5b6d6dSopenharmony_ci 242e5b6d6dSopenharmony_ciint main(int argc, const char* const argv[]) { 252e5b6d6dSopenharmony_ci UErrorCode status = U_ZERO_ERROR; 262e5b6d6dSopenharmony_ci char sysTimeStr[256]; 272e5b6d6dSopenharmony_ci struct tm summerTimeTM; 282e5b6d6dSopenharmony_ci struct tm winterTimeTM; 292e5b6d6dSopenharmony_ci 302e5b6d6dSopenharmony_ci memset(sysTimeStr, 0, sizeof(sysTimeStr)); 312e5b6d6dSopenharmony_ci memset(&summerTimeTM, 0, sizeof(summerTimeTM)); 322e5b6d6dSopenharmony_ci memset(&winterTimeTM, 0, sizeof(winterTimeTM)); 332e5b6d6dSopenharmony_ci 342e5b6d6dSopenharmony_ci strptime("2006-06-01 12:00", "%Y-%m-%d %H:%M", &summerTimeTM); 352e5b6d6dSopenharmony_ci strftime(sysTimeStr, sizeof(sysTimeStr)-1, "%Y-%m-%d %H:%M", &summerTimeTM); 362e5b6d6dSopenharmony_ci puts(sysTimeStr); 372e5b6d6dSopenharmony_ci} 38