Davy Mitchell wrote:
> IronPython console: IronPython 2.0A4 (2.0.10904.02) on .NET 2.0.50727.312
> Copyright (c) Microsoft Corporation. All rights reserved.
>   
>>>> from System.DateTime import Now
>>>> print Now
>>>>         
> 07/10/2007 21:23:20
>   
>>>> print "a few seconds later" + Now.ToString()
>>>>         
> a few seconds later07/10/2007 21:23:20
>   
>>>> from System.DateTime import Now
>>>> print Now
>>>>         
> 07/10/2007 21:24:02
>   
>
> Huh?!??! :-)
>
>   

That's kind of what I would expect. :-)

Now is actually a (static) member of the DateTime class - but in .NET 
you can do this kind of import.

DateTime instances are immutable - so accessing 'Now' returns the 
current one (which doesn't then change). When you import again you 
look-up the new current time.

Just import DateTime and access 'Now' whenever you need it...

Michael
http://www.manning.com/foord
_______________________________________________
Users mailing list
[email protected]
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Reply via email to