Java ZoneId parseBuildTimestamp(String buildTimestamp)

Here you can find the source of parseBuildTimestamp(String buildTimestamp)

Description

parse Build Timestamp

License

Creative Commons License

Declaration

public static ZonedDateTime parseBuildTimestamp(String buildTimestamp) 

Method Source Code

//package com.java2s;
//License from project: Creative Commons License 

import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;

import java.util.Date;

public class Main {
    public static ZonedDateTime parseBuildTimestamp(String buildTimestamp) {
        return parseToZonedDateTime(buildTimestamp + " +0000", "yyyy-MM-dd HH:mm Z");
    }//  w  w  w  .  ja  v a2s.c om

    public static ZonedDateTime parseToZonedDateTime(String dateString, String pattern) {
        return ZonedDateTime.parse(dateString, DateTimeFormatter.ofPattern(pattern));
    }

    public static ZonedDateTime parseToZonedDateTime(Date date) {
        return date.toInstant().atZone(getZoneId());
    }

    private static ZoneId getZoneId() {
        return ZoneId.systemDefault();
    }
}

Related

  1. getTimeZoneId(final TimeZone tz)
  2. getZoneDateTime(Date d, String tzId)
  3. getZoneId()
  4. getZoneId(String tzId)
  5. now()
  6. parseDateTime(String yyyymmdd, String hhmmss)
  7. parseDateToZdt(Date date)
  8. parseTimeZone(String timeZoneStr)
  9. slugifyDate(Long epochMillis)