package com.zfire.jiasm.syncdata;

import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import lombok.Data;
import org.springframework.beans.BeanUtils;

import java.sql.Timestamp;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.util.Calendar;
import java.util.Date;
import java.util.UUID;

import static jdk.nashorn.internal.objects.NativeString.trim;


public class test {

    @Data
    public static class A{
        private Integer id;
        private String websitId;
        private String orderBaseId;
    }

    @Data
    public static class B{
        private Integer id;
        private String websitId;
        private String orderBaseId;
    }

    public static void main(String[] args) throws ParseException {
       /* A a = new A();
        B b = new B();

        B c = new B();

        a.setWebsitId(a.getOrderBaseId());

        a.setId(1);
        a.setWebsitId("A");
        a.setOrderBaseId("A");

        BeanUtils.copyProperties(a, b);

        BeanUtils.copyProperties(a, c,new String[] {"websitId"});

        System.out.println(IdWorker.getIdStr());
        System.out.println(UUID.randomUUID().toString());


        Date date = new Date();
        System.out.println("写代码的当前时间是"+date);
        long time = date.getTime();
//        System.out.println(time);
        Date newDate = new Date();
        newDate.setTime(time + 1000);
        System.out.println("加一秒"+ newDate);
        newDate.setTime(time + 1000*60);
        System.out.println("加一分"+ newDate);
        newDate.setTime(time + 1000*60*60);
        System.out.println("加一时"+ newDate);
        newDate.setTime(time + 1000*60*60*24);*/

/*

        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        DateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

        Date date = new Timestamp(1689651148);

        System.out.println(sdf.format(date));
        System.out.println(format.parse(sdf.format(date)));

*/


        long timeStamp = 1691132713 * 1000L; // 时间戳，单位：毫秒
        Date date = new Date(timeStamp);
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String formatTime = sdf.format(date);
        System.out.println(formatTime);


    }


}
