Definition at line 90 of file runlumi.py.
◆ __repr__()
| python.sugar.runlumi.TimestampType.__repr__ |
( |
| self | ) |
|
Definition at line 94 of file runlumi.py.
94 def __repr__(self):
95 return str(self.date) + " UTC"
96
◆ __str__()
| python.sugar.runlumi.TimestampType.__str__ |
( |
| self | ) |
|
Definition at line 97 of file runlumi.py.
97 def __str__(self):
98 return self.__repr__()
99
◆ date()
| python.sugar.runlumi.TimestampType.date |
( |
| self | ) |
|
Definition at line 101 of file runlumi.py.
102 if self == IOV_MAX:
103 return "([MAX]:[MAX])"
104 try:
105 return date_from_timestamp(self/1e9)
106 except ValueError:
107 return "[InvalidDate]"
108
std::string date()
sadly, includes a return at the end
◆ from_date()
| python.sugar.runlumi.TimestampType.from_date |
( |
| cls, |
|
|
| date ) |
Definition at line 110 of file runlumi.py.
110 def from_date(cls, date):
111 return cls((timegm(date.utctimetuple()) * 1000000000)
112 + 1000*date.microsecond)
113
◆ from_string()
| python.sugar.runlumi.TimestampType.from_string |
( |
| cls, |
|
|
| date_string ) |
Create a TimestampType IOVKey from a %d/%m/%Y string or %H:%M:%S
Definition at line 115 of file runlumi.py.
115 def from_string(cls, date_string):
116 """
117 Create a TimestampType IOVKey from a %d/%m/%Y string or %H:%M:%S
118 """
119 try:
120 d = datetime.strptime(date_string, "%d/%m/%Y")
121 except ValueError:
122 try:
123 d = datetime.strptime(date_string, "%d/%m/%Y %H:%M:%S")
124 except ValueError:
125 log.exception("Invalid")
126 raise
127
128 return cls.from_date(d)
◆ __slots__
| tuple python.sugar.runlumi.TimestampType.__slots__ = () |
|
staticprivate |
◆ date
| python.sugar.runlumi.TimestampType.date |
◆ is_time
| bool python.sugar.runlumi.TimestampType.is_time = True |
|
static |
The documentation for this class was generated from the following file: