English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

This is the code:

time_t rawtime;
struct tm * timeinfo;
time ( &rawtime );
timeinfo = localtime ( &rawtime );

It is now set as follow:
Www Mmm dd hh:mm:ss yyyy

I want to leave only this way:

Mmm_dd

How do I do it?

2006-11-18 21:38:15 · 4 answers · asked by Ilham Aliyev 2 in Computers & Internet Programming & Design

4 answers

to do this,use the strftime() function available in time.h

this function creates a string time out of the tm struct and allows you to specify the format of the time.
You can check out how to specify the format in the help of your compiler, and if you dont find out how, email me personally( I have left that unblocked ).

Yours
Harry Bazeegar

2006-11-18 21:51:14 · answer #1 · answered by Harry Bazeegar 2 · 0 0

I'd suggest you pull the month and day data out of the tm structure. You'll have to convert the numeric month to a 3-letter month abbreviation using either indexing into a string ("JanFebMar...") or create an array of strings containing the month abbreviations. If you do the latter then you can easily get the form you want using and sprintf with field qualifiers to limit size.

2006-11-18 21:49:36 · answer #2 · answered by Anonymous · 0 0

This is the code:

time_t rawtime;
struct tm * timeinfo;
time ( &rawtime );
timeinfo = localtime ( &rawtime );

It is now set as follow:
Www Mmm dd hh:mm:ss yyyy

I want to leave only this way:

Mmm_dd

How do I do it?

2006-11-18 21:41:50 · answer #3 · answered by tom 3 · 0 3

are you azeri?

2006-11-18 21:41:51 · answer #4 · answered by kam_rany4 1 · 0 1

fedest.com, questions and answers