Python: Function simplifying the input instead of passing string -
i need enter complex string handling (utc time code) , breaking down part of assignment. have started function required:
def convertwmidatetime(wmidatetime): but when enter this:
convertwmidatetime(20061122185433.000000+600) the variable wmidatetime stores 2.0061122186e+13
if use raw_input value 20061122185433.000000+600 stored correctly in wmidatetime, not when called intended above.
is there way preserve typed input? way stop pythong calculating , simplifying number? vb. net (wmidatetime string) there python?
thanks looking.
your function requires string input parameter. can't call number (as you're doing).
raw_input() returns string, equivalent call
convertwmidatetime("20061122185433.000000+600") your version treats time code floating point number a) doesn't have required precision preserve digits , b) timezone info (+600) added, leads wrong results well.
Comments
Post a Comment