예제 #1
0
 def test_to_local_fallback(self):
     self.assertTrue(
         timezone.to_local_fallback(
             make_aware(datetime.utcnow(), timezone.utc)),
     )
     self.assertTrue(
         timezone.to_local_fallback(datetime.utcnow())
     )
예제 #2
0
 def test_to_local_fallback(self):
     self.assertTrue(
         timezone.to_local_fallback(
             make_aware(datetime.utcnow(), timezone.utc)),
     )
     self.assertTrue(
         timezone.to_local_fallback(datetime.utcnow())
     )
예제 #3
0
def aware_tstamp(secs):
    """Event timestamps uses the local timezone."""
    return timezone.to_local_fallback(datetime.fromtimestamp(secs))
예제 #4
0
def aware_tstamp(secs):
    """Event timestamps uses the local timezone."""
    return timezone.to_local_fallback(datetime.fromtimestamp(secs))