1 /* 2 * Copyright (c) 2003, Intel Corporation. All rights reserved. 3 * Created by: majid.awad REMOVE-THIS AT intel DOT com 4 * This file is licensed under the GPL license. For the full content 5 * of this license, see the COPYING file at the top level of this 6 * source tree. 7 * 8 * 9 * This test shall return a pointer to the tm structure when converting 10 * a time value to a broken down local time. 11 */ 12 13 #include <stdio.h> 14 #include <time.h> 15 #include "posixtest.h" 16 main(void)17int main(void) 18 { 19 time_t current_time; 20 struct tm *timeptr; 21 22 current_time = time(NULL); 23 timeptr = NULL; 24 timeptr = localtime(¤t_time); 25 26 if (timeptr != NULL) { 27 printf("date: %s, ", (asctime(localtime((¤t_time))))); 28 puts("Test PASSED"); 29 return PTS_PASS; 30 } else { 31 puts("Test FAILED: localtime failed"); 32 return PTS_FAIL; 33 } 34 } 35