|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
date and time function in C
hi!
well i want to store date and time in my myql database... time(&now); nowbase = localtime(&now); if (nowbase) { hrtrans = nowbase->tm_hour; printf("Seconds for hours: %d\n", hrtrans); mintrans = nowbase->tm_min ; printf("Seconds for minutes: %d\n", mintrans); printf("SECONDS: %d\n", hrtrans + mintrans + nowbase->tm_sec); day = nowbase->tm_mday; printf("day of month: %d\n", day); month = nowbase->tm_mon; // Jan==0 printf(" month of year: %d\n", month); year = nowbase->tm_year+1900; printf("year: %d\n",year); using this code i can get the values of..hour..minute,,day,,month and year..that is fine...but i also want to store the date in complete format..like 03.05.2003 similarly time...10:30 i cant fdigure out how can i store this in the required format in database... plz guide me waiting |
|
#2
|
||||
|
||||
|
I'm not sure what date format mySQL requires. There is a mySQL section on this forum, so you might want to post your question there as well.
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages > C Programming > date and time function in C |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|