question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Date format does not behave as expected (off by one day)

See original GitHub issue

I have a template with the date specified as e.g., 2021-04-08.

I would expect this formatting:

post.data.date | date('PPP')

To return:

April 8th, 2021

However, it returns:

April 7th, 2021

If I format with the ATOM format, I can see that the issue seems to be related to stripping off the timezone, or something.

post.data.date | date(`ATOM')
=> "2021-04-07T20:00:00-04:00"

(I’m in GMT-4)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:13 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
oscaroterocommented, Apr 10, 2021

Great. You can undo this change in your _config.js and use the latest stable version after releasing this.

0reactions
oscaroterocommented, Nov 29, 2022

@CM-IV If it helps, I’m using environment variables in the Lume tests to avoid different results in my computer and in GitHub actions: https://github.com/lumeland/lume/blob/master/deno.json#L3 I think it’s safer to provide the environment in the cli command.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Fix Excel Dates Formatted as Text - My Online Training Hub
Simply copy an empty cell > Select your date cells > Paste Special > Values & Add! No need to go back and...
Read more >
How to Fix Excel Dates That Won't Change Format - Contextures
How to fix Excel dates that will not change format. Fix dates that end up in the wrong order when sorted. Use built-in...
Read more >
Excel 365 online, date formatting problem.
Dear all, I have a problem with date formatting, I think it is a bug in the program but I'm not sure. When...
Read more >
Is the Javascript date object always one day off?
Javascript's Date class doesn't represent a date, it represents a timestamp (same in Java). To make it a date, it uses a time...
Read more >
Unable to get Excel to recognise date in column - Super User
The problem: Excel does not want to recognize dates as dates, even though through "Format cells - Number - Custom" you are explicitly...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found