Time and Date Function

Posts 115 of 30 · Page 1 of 2
Time and Date Function
This is completely my source so if you use it give credits.

[php]#include <time.h>


struct tm * current_tm;
time_t current_time;time (&current_time);
current_tm = localtime (&current_time);
char *month []={"January","February","March","April","Mai","June ","July","August","September","October","November" ,"December"};
char *Day []={"Sun","Mon","Tue","Wed","Thu","Fri","Sat"};
char *Hour []={"12","1","2","3","4","5","6","7","8","9","10","1 1","12","1","2","3","4","5","6","7","8","9","10"," 11"};
char *Sec []={"00","01","02","03","04","05","06","07","08","09 ","10","11","12","13","14","15","16","17","18","19 ","20","21","22","23","24","25","26","27","28","29 ","30","31","32","33","34","35","36","37","38","39 ","40","41","42","43","44","45","46","47","48","49 ","50","51","52","53","54","55","56","57","58","59 "};
char *Min []={"00","01","02","03","04","05","06","07","08","09 ","10","11","12","13","14","15","16","17","18","19 ","20","21","22","23","24","25","26","27","28","29 ","30","31","32","33","34","35","36","37","38","39 ","40","41","42","43","44","45","46","47","48","49 ","50","51","52","53","54","55","56","57","58","59 "};
char *logbuf = new char[ 256 ];
sprintf( logbuf, "%s %s %02dth %d || %s:%s:%s",Day[current_tm->tm_wday], month[current_tm->tm_mon], current_tm->tm_mday, current_tm->tm_year+1900, Hour[current_tm->tm_hour], Min[current_tm->tm_min], Sec[current_tm->tm_sec]);
[/php]

And you can say this is kind of noob proof lol

And this is what it looks like.

Nice, thanks dude
Quote Originally Posted by o-o View Post
Nice, thanks dude
Your welcome
Thanks, even though i already have this func another way.
This is a great contribution.
Quote Originally Posted by -ExileD- View Post
Thanks, even though i already have this func another way.
This is a great contribution.
You use C00lGuys source rite
Quote Originally Posted by God601 View Post
You use C00lGuys source rite
Correct.

/ts
Cool but i dont have a menu to use it on so nvm.
Kinda looks like Longvitys one
Quote Originally Posted by ac1d_buRn View Post
Whoa. YOu do it a waste of time way, Thats for sure xD
Mine is a simple PrintText(blah,cTime);
yea but this way you can draw the characters any way you want too

Quote Originally Posted by Mr.Magicman View Post
Kinda looks like Longvitys one
Never seen his but i coded this all from scratch yesterday
Whoa. YOu do it a waste of time way, Thats for sure xD
Mine is a simple PrintText(blah,cTime);
Off topic but God601 can ya fix my code pls.
You made this harder than it was
/fp

Good Job anyway /
Going over a quick glance of the code isnt it going to print "th" after everything.


So it would be September 1th, 2010 instead of Spetember 1"st", 2010. /
WOW U CAN TELL TIME 0.0
Posts 115 of 30 · Page 1 of 2
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Need help?