Basic crowdfunding.
[wolnelektury.git] / wolnelektury / utils.py
diff --git a/wolnelektury/utils.py b/wolnelektury/utils.py
new file mode 100644 (file)
index 0000000..ad57222
--- /dev/null
@@ -0,0 +1,11 @@
+import pytz
+from django.utils import timezone
+from django.conf import settings
+
+def localtime_to_utc(localtime):
+    return timezone.utc.normalize(
+        pytz.timezone(settings.TIME_ZONE).localize(localtime)
+    )
+
+def utc_for_js(dt):
+    return dt.strftime('%Y/%m/%d %H:%M:%S UTC')