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

Popular posts from this blog

.htaccess - First slash is removed after domain when entering a webpage in the browser -

Automatically create pages in phpfox -

c# - Farseer ContactListener is not working -