[Solved] Simplest way to fill working day table

You can use a recursive CTE to accomplish this. This only excludes the weekends. Using DATEFIRST you can figure out what day is a weekend. This query should work no matter what day of the week is set to DATEFIRST. ;WITH DatesCTE AS ( SELECT CAST(‘2016-01-01’ AS DATE) AS [workingDays] UNION ALL SELECT DATEADD(DAY, 1, … Read more

[Solved] CSV file generation in every 2 hours using Java

I am not using ScheduledExecutorService. I want simple way to solve this problem. You already have your answer: The Executors framework was added to Java to be that simple way to solve this problem. Executors abstract away the tricky messy details of handling background tasks and threading. Your should be using a ScheduledExecutorService for your … Read more

[Solved] Java Date and utcTimeOffset [closed]

java.time, the modern Java date and time API ZoneId danishTime = ZoneId.of(“Europe/Copenhagen”); DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern(“uuuuMMddHHmmss”); DateTimeFormatter offsetFormatter = DateTimeFormatter.ofPattern(“XX”); String dateTimeString = “20180730131847”; String offsetString = “+0200”; ZoneOffset offset = ZoneOffset.from(offsetFormatter.parse(offsetString)); ZonedDateTime dateTime = LocalDateTime.parse(dateTimeString, dateTimeFormatter) .atOffset(offset) .atZoneSameInstant(danishTime); System.out.println(“Danish time: ” + dateTime); Output from this code is: Danish time: 2018-07-30T13:18:47+02:00[Europe/Copenhagen] The time zone … Read more

[Solved] user friendly date format using python

With given format, you can use dateutil.parser.parse to handle it. Here’s some code: d = “2017-10-23T03:36:23.337+02:00” time = dateutil.parser.parse(d) print(time.strftime(“%d/%m/%y %H/%M/%S”)) The output is: 23/10/17 03/36/23 4 solved user friendly date format using python