From ae5d76432e40ca44d5d7db3c34dbd564ed43289f Mon Sep 17 00:00:00 2001 From: Antonio de la Rosa Date: Sun, 10 Jan 2016 04:02:28 +0100 Subject: [PATCH] Added new fucntion to datetime library --- paramecio/citoplasma/datetime.py | 7 +++++++ tests/datetimetest.py | 3 +++ 2 files changed, 10 insertions(+) diff --git a/paramecio/citoplasma/datetime.py b/paramecio/citoplasma/datetime.py index 914463d..d2f0e61 100644 --- a/paramecio/citoplasma/datetime.py +++ b/paramecio/citoplasma/datetime.py @@ -129,6 +129,13 @@ def checkdatetime(y, m, d, h, mi, s): except: return False +# Obtain the actual time in gmt + +def now(): + + actual=datetime.today() + + return actual.strftime(sql_format_time) def obtain_timestamp(timeform): diff --git a/tests/datetimetest.py b/tests/datetimetest.py index fe84710..833e50a 100644 --- a/tests/datetimetest.py +++ b/tests/datetimetest.py @@ -38,6 +38,9 @@ class TestFieldMethods(unittest.TestCase): self.assertEqual(date_from_utc, '2012/10/27') + #today=datetime.now() + + #print(today) """ tz=datetime.obtain_timezone('Europe/Madrid')