Every line of 'python datetime now' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your Python code is secure.
98 def Now(): 99 """ current date and tile 100 """ 101 return DateTime()
188 def now(): 189 """ 190 Return an aware or naive datetime.datetime, depending on settings.USE_TZ. 191 """ 192 if settings.USE_TZ: 193 # timeit shows that datetime.now(tz=utc) is 24% slower 194 return datetime.utcnow().replace(tzinfo=utc) 195 else: 196 return datetime.now()
35 @classmethod 36 def now(cls): 37 return FAKE_NOW
24 def getNow (): # Avoid operator overloading, which would result in the dysfunctional: __new__ __call__ (Date) 25 return __new__ (Date ())
32 def date(): 33 return datetime.now()
112 def datenow(): 113 try: 114 (Y, M, D, h, m, s, c, u) = time.localtime() 115 return '%d-%d-%d %d:%d:%d' % (Y, M, D, h, m, s) 116 except: 117 return time.time()
68 def get_now_date(): 69 """Return a datetime object of current time""" 70 return (datetime.datetime.utcnow() 71 .isoformat() + 'Z')
64 def now(): 65 return time.strftime("[%Y-%m-%d %X] ")
14 def now(dt=False): 15 d = datetime.utcnow() 16 d = d.replace(tzinfo=pytz.utc) 17 if dt: 18 return d 19 else: 20 return int(d.strftime('%s'))
5 def get_date_now(): 6 return datetime.datetime.utcnow().isoformat()