Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C (http://www.go4expert.com/forums/c/)
-   -   Change the Date format in C (http://www.go4expert.com/forums/change-date-format-c-t21948/)

Poonamol 30Apr2010 11:13

Change the Date format in C
 
Hi,

Input date is in mm/dd/yyyy format and I want to write a function to change the date format in yyyy-mm-dd format.

Thanks in advance.

satyedra pal 30Apr2010 12:35

Re: Change the Date format in C
 
Code:

For finding the format of date and time with different form,then we can use the following code:

 #include<Windows.h>
 
#include<stdio.h>

 void main()
{
        SYSTEMTIME var_t;
       
        GetSystemTime(&var_t);
       
          printf("%d\t:%d\t:%d\t:%d\t:%d\t:% d\t"        ,var_t.wYear,var_t.wMonth,var_t.wDay
        ,var_t.wHour,var_t.wMinute,var_t.wSecond);

}


xpi0t0s 3May2010 12:04

Re: Change the Date format in C
 
How far have you got and where are you stuck? This is *really easy* to do. This is not a free homework service; you must show your work and we will help you get unstuck. But I'm surprised you could be stuck with this; it's just a case of rearranging the string, so have you even tried?


All times are GMT +5.5. The time now is 21:31.