Hi,
Dates are a little confusing at first when you come to python from VB
or PHP. In python, a date is not a string, but an object. Here's some
example code :
import datetime
now = datetime.datetime.now()
some_date = datetime.datetime(2008,1,1,0,0)
if now == some_date:
they were the same
I'm guessing that your date in settings is a string, rather than a
datetime object.
Check out the python docs on datetime at
http://docs.python.org/lib/datetime-datetime.html
Hope that helps,
Mike
On 24 Mar 2008, at 01:52, julichrist wrote:
>
>
> hi, i'm using django framework. but now i'm facing some problem... i
> want to
> check if the system time is the same with the time that user input?
> i don't
> know how to do it in django framework... but i'm sure in VB, php or
> something just like this
>
> if date() = "07:00" then
> bootds
> end if
>
> just now i try this code
>
> {% ifequal now "H:i" settings.temptime %}
> aaa
> {% endifequal %}
>
> and one more thing, i have a module in models.py to wake on lan...
> so what
> i'm trying to do is, make some schedulling program... to auto start
> the
> client computer and auto shut down that computer... on specific
> time... so i
> need to check if the system time is the same with the time that user
> specific, then call the module in models.py..
>
> anyone can help i even don't know how to call module in django
> --
> View this message in context:
> http://www.nabble.com/Python-using-django-framework-tp16173503p16173503.html
> Sent from the django-users mailing list archive at Nabble.com.
>
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---