* Frontend version of GetCurrentTimestamp(), since we are not linked with * backend code. */
| 606 | * backend code. |
| 607 | */ |
| 608 | TimestampTz |
| 609 | feGetCurrentTimestamp(void) |
| 610 | { |
| 611 | TimestampTz result; |
| 612 | struct timeval tp; |
| 613 | |
| 614 | gettimeofday(&tp, NULL); |
| 615 | |
| 616 | result = (TimestampTz) tp.tv_sec - |
| 617 | ((POSTGRES_EPOCH_JDATE - UNIX_EPOCH_JDATE) * SECS_PER_DAY); |
| 618 | result = (result * USECS_PER_SEC) + tp.tv_usec; |
| 619 | |
| 620 | return result; |
| 621 | } |
| 622 | |
| 623 | /* |
| 624 | * Frontend version of TimestampDifference(), since we are not linked with |
no test coverage detected