Get Time Zone

Get the time zone where the server is located.

Request Format

GET https://{apigw-address}/dataflow-batch-service/v2.0/time?action=getTimeZone

Response Parameters

Name

Data Type

Description

data

TimeZone Struct

Time zone information. See TimeZone Struct

TimeZone Struct

Sample

{
  "timezone": "GMT+8"
}

Parameters

Name

Data Type

Description

timezone

String

Time zone information, by the format of GMT+N.

Error Code

Code

Message

Description

62109

Server internal exception

Server internal exception

Sample

Request Sample

url: https://{apigw-address}/dataflow-batch-service/v2.0/time?action=getTimeZone

method: GET

Return Sample

{
  "status": 0,
  "msg": "Success",
  "data": {
    "timezone": "GMT+8"
  }
}

Java SDK Sample

import com.alibaba.fastjson.JSONObject;
import com.envision.apim.poseidon.config.PConfig;
import com.envision.apim.poseidon.core.Poseidon;

public class Request extends PoseidonRequest {
    public void setQueryParam(String key, Object value){
        QueryParams().put(key, value);
    }
    public void setHeaderParam(String key, String value){
        headerParams().put(key, value);
    }
    public void setBodyParam(Map<String, Object> bodyPara){
        bodyParams().putAll(bodyPara);
    }
    public void setMethod(String method) {
        this.method = method;
    }
    private String method;
    public String baseUri() {
        return "";
    }
    public String method() {
        return method;
    }
}

public static void GetTimeZoneTest(){
        //1. Select Application Registration from the left navigation bar of EnOS Console.
        //2. Open the App Detail page to get the AccessKey and SecretKey of the application.
        String accessKey = "*****************";
        String secretKey = "*****************";

        //Create a request and save the required parameters in the map of the Query.
        Request request = new Request();
        request.setMethod("GET");

        try {
              JSONObject response = Poseidon.config(PConfig.init().appKey(accessKey).appSecret(secretKey).debug())
                .url("https://{apigw-address}/dataflow-batch-service/v2.0/time?action=getTimeZone")
                .getResponse(request, JSONObject.class);

            System.out.println(response);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }