Change the Date format in C

Poonamol's Avatar, Join Date: Mar 2010
Go4Expert Member
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's Avatar, Join Date: Mar 2010
Contributor
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's Avatar, Join Date: Aug 2004
Mentor
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?