Orbits
1
|
Functions | |
def | epoch2dt_UTC |
def | epoch2dt_local |
def | dt2epoch_local |
def | dt2epoch_UTC |
def | manual2dt |
def | tuple2dt |
def | dt2tuple |
def | str2dt |
def | hyphstr2dt |
def | dt2str |
def | dt2str_uri |
def | dt2str_hyph |
def | dt2str_day |
def | is_dt |
def orbits.src.DTHelpers.dt2epoch_local | ( | dtime | ) |
expects local dtime, preserves timezone
if given UTC, output same as dt2epoch_UTC
def orbits.src.DTHelpers.dt2epoch_UTC | ( | dtime | ) |
expects UTC datetime object
def orbits.src.DTHelpers.dt2str | ( | dtime | ) |
output format: YYYY-MM-DD HH:MM:SS.ms
def orbits.src.DTHelpers.dt2str_day | ( | dtime | ) |
output format: YYYY-MM-dd
def orbits.src.DTHelpers.dt2str_hyph | ( | dtime | ) |
def orbits.src.DTHelpers.dt2str_uri | ( | dtime | ) |
output format: YYYY-MM-DD%20HH:MM:SS
def orbits.src.DTHelpers.dt2tuple | ( | dtime | ) |
Convert datetime object to time tuple
Output format: time.struct_time(tm_year=2013, tm_mon=1, tm_mday=1,\ tm_hour=0, tm_min=0, tm_sec=0, tm_wday=1, tm_yday=1, tm_isdst=-1)
NOTE: time tuple serializes poorly.
Prefer strings or epoch if creating JSON
def orbits.src.DTHelpers.epoch2dt_local | ( | epoch_time | ) |
Converts epoch in local time to datetime
Expects format: 1410449241.01
def orbits.src.DTHelpers.epoch2dt_UTC | ( | epoch_time | ) |
Converts epoch in UTC time to datetime
Expects format: 1410449241.01
def orbits.src.DTHelpers.hyphstr2dt | ( | hyphstr | ) |
"input format: 2008-11-10-17-53-59-000317 microseconds optional
def orbits.src.DTHelpers.is_dt | ( | time | ) |
Validate that input is a datetime.datetime object
def orbits.src.DTHelpers.manual2dt | ( | year = 2014 , |
|
month = 1 , |
|||
day = 1 , |
|||
hour = 0 , |
|||
minute = 0 , |
|||
second = 0 , |
|||
microsecond = 0 |
|||
) |
Manually create datetime from parameters
def orbits.src.DTHelpers.str2dt | ( | time_str | ) |
"input format: 2008-11-10 17:53:59.000317 microseconds optional
def orbits.src.DTHelpers.tuple2dt | ( | time_tuple | ) |
Convert time tuple to datetime object
Input format: (2008, 11, 10, 17, 53, 59, 123317)
Copyright 2014 Google Inc. All rights reserved.