Javascript - 将CEST日期转换为本地用户日期

时间:2017-04-21 19:53:47

标签: javascript date timezone

我的服务器在CEST时区返回日期。有没有办法将该日期转换为本地用户日期?像

这样的东西
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.Toast;

public class AnimationActivity extends AppCompatActivity implements Animation.AnimationListener {

    ImageView imageIcon;
    Button btnStart;

    // Animation
    Animation animMoveToTop;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_animation);

        imageIcon = (ImageView) findViewById(R.id.icon);
        btnStart = (Button) findViewById(R.id.btnStart);

        // load the animation
        animMoveToTop = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.move);

        // set animation listener
        animMoveToTop.setAnimationListener(this);

        // button click event
        btnStart.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View v) {
                imageIcon.setVisibility(View.VISIBLE);

                // start the animation
                imageIcon.startAnimation(animMoveToTop);
            }
        });
    }

    @Override
    public void onAnimationEnd(Animation animation) {
        // Take any action after completing the animation
        // check for move animation
        if (animation == animMoveToTop) {
            Toast.makeText(getApplicationContext(), "Animation Stopped", Toast.LENGTH_SHORT).show();
        }
    }

    @Override
    public void onAnimationRepeat(Animation animation) {
        // TODO Auto-generated method stub
    }

    @Override
    public void onAnimationStart(Animation animation) {
        // TODO Auto-generated method stub
    }
}

我找到了Moment.js库,但我找不到文档中不同时区转换的时区。

0 个答案:

没有答案