How can I alter/specify the output of the following call?
import pandas as pd
pd.to_datetime('now')
Gives me e.g.
Timestamp('2018-05-09 09:56:36')
.to_datetime has a format parameter, but
pd.to_datetime('now', format='%Y%m%d-%H%M%S')
but this gives me a
ValueError: time data 'now' does not match format '%Y%m%d-%H%M%S' (match)
I also tried
pd.to_datetime('now').dt_strftime('%Y%m%d-%H%M%S')
but I end up with
AttributeError: 'Timestamp' object has no attribute 'dt_strftime'
How can achieve an output '%Y%m%d-%H%M%S'
here?
I am using Python 3.6.4 and Pandas 0.22.0.