Handling Date time - salmanbaig8/imp GitHub Wiki

LocalDateTime localDateTime = LocalDateTime.now(); ZonedDateTime dateAndTime = ZonedDateTime.of(localDateTime, ZoneId.of("GMT+05:30"));

	logger.debug("Current date and time in a particular timezone : " + dateAndTime);

	ZonedDateTime utcDate = dateAndTime.withZoneSameInstant(ZoneOffset.UTC);

	logger.debug("Current date and time in UTC : " + utcDate);
	
	String utc  = StringUtils.substringBefore(utcDate.toString(), DOT);
	String dcrstDate = utc.concat(DOT).concat("000+00:00");