[ptt-users] Todays Date in Testcase

Kyle Bell kylebell at tango-networks.com
Mon Jul 9 14:45:22 PDT 2007


Geoff,

I do it this way:

print time.strftime("%x %X",time.localtime())

Look up the use of strftime.  It will format your string in a variety of
ways.

http://www.python.org/doc/lib/module-time.html

Regards,

Kyle Bell
Test and Automation Architect
Tango Networks
http://www.tango-networks.com

On Mon, 2007-07-09 at 15:53 -0500, Thieme.Geoff wrote:
> How do I get today's data into a Testcase using Python code. I tried:
> 
> import time
> import datetime 
> ...
> mydate = datetime.date.today()
> self.params = [ [ '''MyUrlDate''', mydate ] ]
> ...
> 
> It says datetime is not an available module.
> 
> Eventually I need to get the date in format mm/dd/yyyy.
> 
> Thanks,
> Geoff
> _______________________________________________
> Users mailing list
> Users at lists.pushtotest.com
> http://lists.pushtotest.com/mailman/listinfo/users
> 



More information about the Users mailing list