Skip to content

Commit

Permalink
Use UTC rather than local time in timestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
arista-nwolfe committed May 2, 2024
1 parent 64c61e9 commit f2d6606
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions orchagent/portsorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3122,15 +3122,15 @@ void PortsOrch::updateDbPortFlapCount(Port& port, sai_port_oper_status_t pstatus
{
char buffer[32];
// Format: Www Mmm dd hh:mm:ss yyyy
std::strftime(buffer, sizeof(buffer), "%a %b %d %H:%M:%S %Y", std::localtime(&now_c));
std::strftime(buffer, sizeof(buffer), "%a %b %d %H:%M:%S %Y", std::gmtime(&now_c));
FieldValueTuple tuple("last_down_time", buffer);
tuples.push_back(tuple);
}
else if (pstatus == SAI_PORT_OPER_STATUS_UP)
{
char buffer[32];
// Format: Www Mmm dd hh:mm:ss yyyy
std::strftime(buffer, sizeof(buffer), "%a %b %d %H:%M:%S %Y", std::localtime(&now_c));
std::strftime(buffer, sizeof(buffer), "%a %b %d %H:%M:%S %Y", std::gmtime(&now_c));
FieldValueTuple tuple("last_up_time", buffer);
tuples.push_back(tuple);
}
Expand Down

0 comments on commit f2d6606

Please sign in to comment.