新版仿ok交易所-后端
zyy3
2026-03-03 1256f9068913160f9893b4382cb408835a54349a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package com.yami.trading.bean.data.domain;
 
import lombok.Data;
 
import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;
 
@Data
public class StockMarket {
    private static DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MM-dd HH:mm:ss");
 
    private String symbol;
    private String status_id;
    private String region;
    private String status;
    private String time_zone;
    private String time_str;
 
    public void calculate() {
        ZonedDateTime now = ZonedDateTime.now(ZoneId.of(time_zone));
        // 格式化日期和时间
        String formattedDateTime = now.format(formatter);
        this.time_str = formattedDateTime;
    }
 
}