Skip to content

isToday(new UTCDate()) => false #3730

@tilowestermann

Description

@tilowestermann

There is an issue with the isToday function

The problem

💻 Code demonstrating the problem

import { UTCDate } from '@date-fns/utc';
import { isToday } from 'date-fns';

isToday(new UTCDate());
//=> false

Demo: https://stackblitz.com/edit/stackblitz-starters-bdluhl?file=src%2Fmain.ts

🙁 Actual behavior

new UTCDate() is not today

🙂 Expected behavior

new UTCDate() is today

Debug information

  • date-fns version: 3.4.0 (@date-fns/utc: 1.2.0)
  • Browser/Node.js version: Edge
  • Your timezone: UTC+1
  • Your current time: 15:00

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions