We can convert a datetime value in to decimal using following function.
import time
from datetime import datetime
t = datetime.now()
t1 = t.timetuple()
print time.mktime(t1)
Output :
Out[9]: 1395136322.0
Similarly is there a way to convert strings in to a decimal using python?.
Example string.
"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:27.0) Gecko/20100101 Firefox/27.0"
time.mktime(). It returns the number of seconds since Jan 1, 1970. Thus instead of representing dates as (day, month, year) since Jesus, it represents times/dates as seconds since 1970. There's not really an analogous representation for arbitrary strings.