Java Code Examples for java.time.Instant.toString()

The following are Jave code examples for showing how to use toString() of the java.time.Instant class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: vars-annotation   File:   Source Code and License Vote up 5 votes
 * Creates the textual overlay for the preview image
 * @param copyrightOwner
 * @param framegrab
 * @param imageUploadResults
 * @return  A string array of ext to be overlaid onto an image.
public static String[] createOverlayText(String copyrightOwner, Framegrab framegrab, ImageUploadResults imageUploadResults) {
    final String[] s = new String[4];
    Instant copyrightDate = getCopyrightDate(framegrab);
    int year = copyrightDate.atZone(ZoneId.of("UTC")).get(ChronoField.YEAR);
    imageUploadResults.getUri().toString().replace(".png", ".jpg");
    s[0] = "Copyright " + year + " " +  copyrightOwner;
    s[1] = imageUploadResults.getUri().toString();
    s[2] = copyrightDate.toString();
    s[3] = "";

    return s;
Example 2
Project: lams   File:   Source Code and License Vote up 4 votes
public String print(Instant object, Locale locale) {
	return object.toString();
Example 3
Project:   File:   Source Code and License Vote up 4 votes
public JsonElement serialize(LocalDateTime localDateTime, Type type,
    JsonSerializationContext jsonSerializationContext) {
    Instant instant = localDateTime.toInstant(ZoneOffset.UTC);
    return new JsonPrimitive(instant.toString());
Example 4
Project: ExoVisix   File:   Source Code and License Vote up 3 votes
public void putOnLog(String data) {

		Instant now =;

		String logs = now.toString() + ":\n" + data;