Subversion Repositories SmartDukaan

Rev

Rev 22242 | Rev 22470 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 22242 Rev 22290
Line 45... Line 45...
45
		String formattedDateTime = localDate.format(formatter); // "1986-04-08 12:30"
45
		String formattedDateTime = localDate.format(formatter); // "1986-04-08 12:30"
46
		return formattedDateTime;
46
		return formattedDateTime;
47
	}
47
	}
48
	
48
	
49
	public static final LocalDateTime toDateTime(String dateTimeString) throws DateTimeParseException{
49
	public static final LocalDateTime toDateTime(String dateTimeString) throws DateTimeParseException{
50
		if(dateTimeString == null || dateTimeString.equals("0")){
50
		if(dateTimeString == null || dateTimeString.equals("0") || dateTimeString.isEmpty()){
51
			return null;
51
			return null;
52
		}
52
		}
53
		LocalDateTime date =
53
		LocalDateTime date =
54
				  Instant.ofEpochMilli(Long.valueOf(dateTimeString))
54
				  Instant.ofEpochMilli(Long.valueOf(dateTimeString))
55
				  .atZone(ZoneId.systemDefault())
55
				  .atZone(ZoneId.systemDefault())