date fix
This commit is contained in:
parent
7a9aa5ae7a
commit
b200eb3b91
@ -154,9 +154,9 @@ func (lock *OmniLockServer) BuildCommand(encoderAddr, lockId string, checkIn, ch
|
|||||||
formattedLockId := fmt.Sprintf("%04d", idInt)
|
formattedLockId := fmt.Sprintf("%04d", idInt)
|
||||||
|
|
||||||
// Format date/time parts
|
// Format date/time parts
|
||||||
ga := checkIn.Format("020106") // GA = ddMMyy
|
dt := checkOut.Format("15:04") // DT = HH:mm
|
||||||
gd := checkOut.Format("020106") // GD = ddMMyy
|
ga := checkIn.Format("060102") // GA = ddMMyy
|
||||||
dt := checkIn.Format("15:04") // DT = HH:mm
|
gd := checkOut.Format("060102") // GD = ddMMyy
|
||||||
ti := checkIn.Format("150405") // TI = HHmmss
|
ti := checkIn.Format("150405") // TI = HHmmss
|
||||||
|
|
||||||
// Construct payload
|
// Construct payload
|
||||||
@ -200,7 +200,7 @@ func (lock *OmniLockServer) LockSequence(conn net.Conn) error {
|
|||||||
func (lock *OmniLockServer) linkStart(conn net.Conn) (string, error) {
|
func (lock *OmniLockServer) linkStart(conn net.Conn) (string, error) {
|
||||||
const funcName = "OmniLockServer.linkStart"
|
const funcName = "OmniLockServer.linkStart"
|
||||||
// Send the link start command
|
// Send the link start command
|
||||||
payload := fmt.Sprintf("LS|DA%s|TI%s|", time.Now().Format("020106"), time.Now().Format("150405"))
|
payload := fmt.Sprintf("LS|DA%s|TI%s|", time.Now().Format("060102"), time.Now().Format("150405"))
|
||||||
command := append([]byte{0x02}, append([]byte(payload), 0x03)...)
|
command := append([]byte{0x02}, append([]byte(payload), 0x03)...)
|
||||||
|
|
||||||
raw, err := sendAndReceive(conn, command)
|
raw, err := sendAndReceive(conn, command)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user