spring-batch icon indicating copy to clipboard operation
spring-batch copied to clipboard

Support Java 8 Dates in Job and Step Execution [BATCH-2590]

Open spring-projects-issues opened this issue 8 years ago • 3 comments

Philippe Marschall opened BATCH-2590 and commented

Currently all timestamps on JobExecution and StepExecution are of type java.util.Date. It would be cool if instead they could be directly a Java 8 Date Time API type, OffsetDateTime and ZonedDateTime are obvious candidates. Ideally the data type of the corresponding database would be changed from TIMESTAMP to TIMESTAMP WITH TIME ZONE as well.


No further details from BATCH-2590

spring-projects-issues avatar May 02 '17 12:05 spring-projects-issues

Yep +1 here. And also consider changing the job parameter types to be java8 Date Time API.

ptahchiev avatar Feb 15 '20 12:02 ptahchiev

@benas - When Spring Batch 5.0.0 will be ready?

javaHelper avatar Mar 22 '22 11:03 javaHelper

@javaHelper It depends on the release date of SF 6, but it is expected for the upcoming Fall.

fmbenhassine avatar Apr 07 '22 11:04 fmbenhassine

While evaluating the change of timestamp fields to OffsetDateTime, several issues popped up, see #4209.

For this reason, we have decided to change the type from java.util.Date to java.time.LocalDateTime for now, and defer the feature of making those fields timezone aware to a future release.

fmbenhassine avatar Oct 11 '22 21:10 fmbenhassine

@fmbenhassine ~Hello, it seem the datatype is still Date, not LocalDateTime on the API(JobParametersBuilder.addDate). Is this issue still ongoing or removed? I can contribute if you allow me to. Thanks.~

uyw4687 avatar Mar 12 '24 09:03 uyw4687

It's off-topic, but is there any rationale to exclude addBoolean on the JobParametersBuilder?

uyw4687 avatar Mar 12 '24 09:03 uyw4687

@fmbenhassine Hello, it seem the datatype is still Date, not LocalDateTime on the API(JobParametersBuilder.addDate). Is this issue still ongoing or removed? I can contribute if you allow me to. Thanks.

It's there?

new JobParametersBuilder()
            .addLocalDateTime(Config.JOB_PARAMETER_NAME_TO_DATE, LocalDateTime.now())

davidkarlsen avatar Mar 12 '24 09:03 davidkarlsen

@davidkarlsen Sorry, I was using spring boot 2. I checked it from code. How about addBoolean? Should I make a new issue?

uyw4687 avatar Mar 13 '24 03:03 uyw4687