views:

52

answers:

1

3.Why does "jan 1st 1970" gets added in the startime field in datastore when I am doing the below statements?

 (hour,min) = self.request.get('starttime').split(":")
 #if either of them is null or empty string then int will throw exception
 if hour and min :
  datastoremodel.starttime = datetime.time(int(hour), int(min))

Although when I retrieve it only time comes through? I wonder what date is doing in datastore? Any clues?

+2  A: 

google app engine doc says

class TimeProperty(verbose_name=None, auto_now=False, auto_now_add=False, ...)
A time property, without a date. Takes a Python standard library datetime.time value. See DateTimeProperty for more information.
Value type: datetime.time. This is converted to a datetime.datetime internally.

so to convert time to a date , start of epoch time "jan 1st 1970" is added

Anurag Uniyal
so its acceptable behavior to google and app, thx so much
dhaval
anyway what's your worry abt how google saves it internally as far as you get correct time back?
Anurag Uniyal