File tree 2 files changed +20
-29
lines changed
2 files changed +20
-29
lines changed Original file line number Diff line number Diff line change @@ -1539,32 +1539,3 @@ parsetinterval(char *i_string,
1539
1539
"tinterval" , i_string )));
1540
1540
* i_start = * i_end = INVALID_ABSTIME ; /* keep compiler quiet */
1541
1541
}
1542
-
1543
-
1544
- /*****************************************************************************
1545
- *
1546
- *****************************************************************************/
1547
-
1548
- /*
1549
- * timeofday -
1550
- * returns the current time as a text. similar to timenow() but returns
1551
- * seconds with more precision (up to microsecs). (I need this to compare
1552
- * the Wisconsin benchmark with Illustra whose TimeNow() shows current
1553
- * time with precision up to microsecs.) - ay 3/95
1554
- */
1555
- Datum
1556
- timeofday (PG_FUNCTION_ARGS )
1557
- {
1558
- struct timeval tp ;
1559
- char templ [128 ];
1560
- char buf [128 ];
1561
- pg_time_t tt ;
1562
-
1563
- gettimeofday (& tp , NULL );
1564
- tt = (pg_time_t ) tp .tv_sec ;
1565
- pg_strftime (templ , sizeof (templ ), "%a %b %d %H:%M:%S.%%06d %Y %Z" ,
1566
- pg_localtime (& tt , session_timezone ));
1567
- snprintf (buf , sizeof (buf ), templ , tp .tv_usec );
1568
-
1569
- PG_RETURN_TEXT_P (cstring_to_text (buf ));
1570
- }
Original file line number Diff line number Diff line change @@ -1609,6 +1609,26 @@ GetSQLLocalTimestamp(int32 typmod)
1609
1609
return ts ;
1610
1610
}
1611
1611
1612
+ /*
1613
+ * timeofday(*) -- returns the current time as a text.
1614
+ */
1615
+ Datum
1616
+ timeofday (PG_FUNCTION_ARGS )
1617
+ {
1618
+ struct timeval tp ;
1619
+ char templ [128 ];
1620
+ char buf [128 ];
1621
+ pg_time_t tt ;
1622
+
1623
+ gettimeofday (& tp , NULL );
1624
+ tt = (pg_time_t ) tp .tv_sec ;
1625
+ pg_strftime (templ , sizeof (templ ), "%a %b %d %H:%M:%S.%%06d %Y %Z" ,
1626
+ pg_localtime (& tt , session_timezone ));
1627
+ snprintf (buf , sizeof (buf ), templ , tp .tv_usec );
1628
+
1629
+ PG_RETURN_TEXT_P (cstring_to_text (buf ));
1630
+ }
1631
+
1612
1632
/*
1613
1633
* TimestampDifference -- convert the difference between two timestamps
1614
1634
* into integer seconds and microseconds
You can’t perform that action at this time.
0 commit comments