Browse Source

调整时间输出格式

develop
H Vs 9 months ago
parent
commit
13f217c3cb
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      NearCardAttendance.Service/TcpServer/Handler/RegisterHandler.cs

+ 2
- 2
NearCardAttendance.Service/TcpServer/Handler/RegisterHandler.cs View File

@@ -271,7 +271,7 @@ namespace NearCardAttendance.Service.TcpServer.Handler
var data = new
{
attendanceStatus = 2, //考勤状态: 0.进 1.出 2.未知
attendanceTime = DateTime.TryParse(startTime, out DateTime time) ? time.ToString("yyyy-MM-dd HH:mm:ss") : DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
attendanceTime = DateTime.ParseExact(startTime, "yyyyMMddHHmmss", null).ToString("yyyy-MM-dd HH:mm:ss"),
imei = config.Imei
};
var res = await _httpHelper.HttpToPostAsync(url, data);
@@ -332,7 +332,7 @@ namespace NearCardAttendance.Service.TcpServer.Handler
var data = new
{
attendanceStatus = int.TryParse(optType, out int type) ? type : 0,
attendanceTime = DateTime.TryParse(startTime, out DateTime time) ? time.ToString("yyyy-MM-dd HH:mm:ss") : DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
attendanceTime = DateTime.ParseExact(startTime, "yyyyMMddHHmmss", null).ToString("yyyy-MM-dd HH:mm:ss"),
imei = config.Imei
};
var res = await _httpHelper.HttpToPostAsync(url, data);


Loading…
Cancel
Save