"date" field in Message object is returned incorrectly
See original GitHub issueAs seen in documentation:
date | Integer | Date the message was sent in Unix time
Aiogram returns formatted datetime instead which is incorrect (expected integer as seen in docs) and makes harder to port code from other libraries.
Test case:
@dp.message_handler()
async def show_datetime(message: types.Message):
print(message.date)
return
Expected output:
>>> 1532863711
Got output:
>>> 2018-07-29 11:28:31
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:8 (8 by maintainers)
Top Results From Across the Web
Return error message if date format isn't correct
Try this: convert.to.date <- function(d) { if(is.na(strptime(d, '%Y-%m-%d %H:%M:%S'))) stop("Format incorrect") return(format(d, ...
Read more >Error: Incorrect parameter type for operator '-'. Expected ...
This error is expected because the operator - requires both the operand of same data type. The NOW() returns a datetime and other...
Read more >Solved: Change date format received from MS Forms in MS Fl...
I have an approval 'Leave Request' flow. It is triggered when a response has been received from an MS Form.
Read more >The Definitive Guide to DateTime Manipulation
The problem with this solution is that it can give an inconsistent length to the dates because some months and days of the...
Read more >Why do date fields import incorrectly when I use the Data ...
Sometimes dates import incorrectly because the Data Loader converts the date specified in the imported .csv file to GMT. If your machine's time...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@JrooTJunior Of course, I can write any number of “helper” methods. The thing is: you’re making a simple API complex just because you want to. But this is not your project (originally). All you had to do was to
I appreciate your “2)”, but you’ve completely failed “1)”. I see you (and community behind you) don’t see any problems here and don’t even feel guilty, so I’ll just close the issue. Good luck making simple things harder because of your fantasies.
Yeah, this is an issue, that @JrooTJunior has to fix (or anyone else) + this:
forward_date: base.Integer = fields.Field()