egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

getting todays date

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Shell & Bouncer Help
View previous topic :: View next topic  
Author Message
pinkel
Voice


Joined: 21 May 2008
Posts: 8

PostPosted: Wed Jun 17, 2009 5:42 am    Post subject: getting todays date Reply with quote

How can I get todays date in format: mmdd

thanks
Back to top
View user's profile Send private message
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Wed Jun 17, 2009 10:03 am    Post subject: Reply with quote

Since you are posting in Shell & Bouncer Help, I assume you are writing a shellscript?
In such case, that would somewhat depend on your shell. Most do provide the date binary, which generally supports formatting (see http://unixhelp.ed.ac.uk/CGI/man-cgi?date ).

Something like this should do the trick (bash-style, other shells may have different syntax):
Code:
somevar=`date +%m%d`

_________________
NML_375, idling at #eggdrop@IrcNET
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Shell & Bouncer Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber