Exemplo n.º 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())
     )
Exemplo n.º 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())
     )
Exemplo n.º 3
0
def aware_tstamp(secs):
    """Event timestamps uses the local timezone."""
    return timezone.to_local_fallback(datetime.fromtimestamp(secs))
Exemplo n.º 4
0
def aware_tstamp(secs):
    """Event timestamps uses the local timezone."""
    return timezone.to_local_fallback(datetime.fromtimestamp(secs))