0

When i work with DateTime i receive the following params.

I/flutter (25000): startTime: 13:46

I/flutter (25000): endTime: 13:49

I manage to parse the date with this.

DateFormat dateFormat = new DateFormat.Hm();
staticStartDate = dateFormat.parse(widget.startTime);

however the result date ends up like this:

I/flutter (25000): 1970-01-01 13:46:00.000

when the result should be.

I/flutter (25000): 2020-09-26 13:46:00.000

Anyone knows how to parse the time but with the current date?

Luis Cardoza Bird
  • 1,265
  • 4
  • 24
  • 43
  • Voting to reopen. This question seems to be about constructing a `DateTime` object without needing to specify the date, whereas the supposed duplicate is about *formatting* a `DateTime`. While I do think this question is a duplicate, I don't think that the linked question is the most appropriate one. – jamesdlin Sep 26 '20 at 18:31
  • 1
    For example, I think https://stackoverflow.com/q/63770437/ is a closer match. – jamesdlin Sep 26 '20 at 18:36

0 Answers0