Commit ce6358a0 authored by Jim Fulton's avatar Jim Fulton

Added osi.

parent 8b51e837
......@@ -44,7 +44,7 @@
"""Encapsulation of date/time values"""
__version__='$Revision: 1.14 $'[11:-2]
__version__='$Revision: 1.15 $'[11:-2]
import sys,os,regex,DateTimeZone
......@@ -1155,6 +1155,16 @@ class DateTime:
self._pmon,self._day,self._year,self._pmhour,
self._minute,self._pm,self._tz)
def osi(self):
"""Return the object in OSI standard format
Dates are output as: YYYY-MM-DD HH:MM:SS
"""
return "%.4d-%.2d-%.2d %.2d:%.2d:%.2d" % (
self._year, self._month, self._day,
self._hour, self._minute, self._second)
def __add__(self,other):
"""A DateTime may be added to a number and a number may be
added to a DateTime; two DateTimes cannot be added."""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment