Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

date in insert record #187

Closed
lidiabressan opened this issue Nov 7, 2019 · 1 comment
Closed

date in insert record #187

lidiabressan opened this issue Nov 7, 2019 · 1 comment
Assignees
Labels

Comments

@lidiabressan
Copy link

A little question: before the last version, it was possible (and very easy to use) to insert a date in a record with a datetime.datetime object, while now I have to specify all integers year, month, day, hour, minute, second. It is possible to re-add this, please?

rec = {
    'lat':float(lat),
    'lon':float(lon),
    'report':report,
    'level':level,
    'trange':trange,
    #'date':data_dato,
    'year':data_dato.year,
    'month':data_dato.month,
    'day':data_dato.day,
    'hour':data_dato.hour,
    'min':data_dato.minute,
    'sec':data_dato.second,
    }
 rec[dballe_var] = dato
 db.insert_data(rec, can_replace=can_replace, can_add_stations=True)

thanks
ciao

@spanezz
Copy link
Contributor

spanezz commented Dec 6, 2019

Good catch! You can use datetime, level, and trange, but they were missing in the documentation. I'll add them now.

@spanezz spanezz closed this as completed in 2fc921d Dec 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants