Skip to content

Commit f6c3383

Browse files
committed
Use UTC rather than local time in timestamp
1 parent 0590213 commit f6c3383

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

orchagent/portsorch.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3122,15 +3122,15 @@ void PortsOrch::updateDbPortFlapCount(Port& port, sai_port_oper_status_t pstatus
31223122
{
31233123
char buffer[32];
31243124
// Format: Www Mmm dd hh:mm:ss yyyy
3125-
std::strftime(buffer, sizeof(buffer), "%a %b %d %H:%M:%S %Y", std::localtime(&now_c));
3125+
std::strftime(buffer, sizeof(buffer), "%a %b %d %H:%M:%S %Y", std::gmtime(&now_c));
31263126
FieldValueTuple tuple("last_down_time", buffer);
31273127
tuples.push_back(tuple);
31283128
}
31293129
else if (pstatus == SAI_PORT_OPER_STATUS_UP)
31303130
{
31313131
char buffer[32];
31323132
// Format: Www Mmm dd hh:mm:ss yyyy
3133-
std::strftime(buffer, sizeof(buffer), "%a %b %d %H:%M:%S %Y", std::localtime(&now_c));
3133+
std::strftime(buffer, sizeof(buffer), "%a %b %d %H:%M:%S %Y", std::gmtime(&now_c));
31343134
FieldValueTuple tuple("last_up_time", buffer);
31353135
tuples.push_back(tuple);
31363136
}

0 commit comments

Comments
 (0)