Android Date Current Get getCurrentDateJSONString()

Here you can find the source of getCurrentDateJSONString()

Description

get Current Date JSON String

Declaration

public static String getCurrentDateJSONString() 

Method Source Code

//package com.java2s;

import java.text.SimpleDateFormat;

import java.util.Date;

import java.util.TimeZone;

public class Main {
    public static String getCurrentDateJSONString() {
        return toUTCFormattedString(new Date());
    }//from   w w  w .java  2  s .c  o  m

    public static String toUTCFormattedString(Date date) {
        SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm'Z'");
        df.setTimeZone(TimeZone.getTimeZone("UTC"));
        return df.format(date);
    }
}

Related

  1. getCurrentDate()
  2. getCurrentDate()
  3. getCurrentDateline()
  4. getCurrentDate()
  5. getCurrentDate()