Incorrect parsing of timestamp's milliseconds with a leading zero
See original GitHub issueDescribe the bug
Given a column of type timestamp, leading zero in milliseconds is ignored. Example: inserted value “2021-03-03T08:31:15.077Z” will be read as “2021-03-03 08:31:15.770000”
To Reproduce
Given following table:
SELECT column_name, data_type FROM information_schema.columns WHERE table_name = 'solutions';
# id | character varying
# created_at | timestamp without time zone
And following test script
const AWS = require('aws-sdk');
const resourceArn = '';
const secretArn = '';
const database = '';
const endpoint = '';
const rdsDataService = new AWS.RDSDataService({ endpoint });
const executeSql = (sql) => rdsDataService.executeStatement({ resourceArn, secretArn, database, sql }).promise();
const test = async (sql) => {
await executeSql(`INSERT INTO solutions (id, created_at) VALUES ('1', '2021-03-03T08:31:15.077Z')`);
const { records } = await executeSql(`SELECT * FROM solutions WHERE id = '1'`);
console.log(records);
}
The output would be following:
[
[
{ stringValue: '1' },
{ stringValue: '2021-03-03 08:31:15.770000' },
]
]
Expected behavior
Is should behave equally to AWS Aurora Data API and return:
[
[
{ stringValue: '1' },
{ stringValue: '2021-03-03 08:31:15.077' },
]
]
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (6 by maintainers)
Top Results From Across the Web
Missing milliseconds, when parsing Java 8 date-time, if they ...
Where the trailing zeros are cut off. This seems to be a issue with the deeper dateTimeFormatter. The issue is if a Json...
Read more >SimpleDateFormat is not parsing the milliseconds correctly
When I do an "ORDER BY TIMESTAMP ASC", timeStamp2 is considered as the greater timestamp(which is correct). Requirement: I need to get the ......
Read more >Time Stamp incorrectly displayed in XLS file when ...
Time Stamp incorrectly displayed in XLS file when Milliseconds is used. Hi all, Got a bit of issue when trying to write the...
Read more >luxon 3.1.1 | Documentation
It contains class and instance methods for creating, parsing, interrogating, transforming, and formatting them. A DateTime comprises of: A timestamp. Each ...
Read more >String + Format
List of all available parsing tokens ; SS, 00-99, Tens of milliseconds, 2-digits ; SSS, 000-999, Milliseconds, 3-digits ; Z · -05:00, Offset...
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 FreeTop 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
Top GitHub Comments
Thank you @koxudaxi! I can confirm the issue is resolved.
I was just writing next bug report 😅 Thank you again!