File tree Expand file tree Collapse file tree 1 file changed +9
-11
lines changed Expand file tree Collapse file tree 1 file changed +9
-11
lines changed Original file line number Diff line number Diff line change 1
1
/* -----------------------------------------------------------------------
2
2
* formatting.c
3
3
*
4
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/formatting.c,v 1.27 2000/12/15 19:15:09 momjian Exp $
4
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/formatting.c,v 1.28 2000/12/23 04:05:31 tgl Exp $
5
5
*
6
6
*
7
7
* Portions Copyright (c) 1999-2000, PostgreSQL, Inc
@@ -2775,16 +2775,14 @@ to_timestamp(PG_FUNCTION_ARGS)
2775
2775
#endif
2776
2776
if (tmfc -> ssss )
2777
2777
{
2778
- int x ;
2779
-
2780
- if (tmfc -> ssss > 3600 )
2781
- tm -> tm_sec = x - ((tm -> tm_min = (x = tmfc -> ssss -
2782
- ((tm -> tm_hour = tmfc -> ssss / 3600 ) * 3600 )) / 60 ) * 60 );
2783
- else if (tmfc -> ssss > 60 )
2784
- tm -> tm_sec = tmfc -> ssss - ((tm -> tm_min = tmfc -> ssss / 60 ) * 60 );
2785
- else
2786
- tm -> tm_sec = tmfc -> ssss ;
2787
- }
2778
+ int x = tmfc -> ssss ;
2779
+
2780
+ tm -> tm_hour = x / 3600 ;
2781
+ x %= 3600 ;
2782
+ tm -> tm_min = x / 60 ;
2783
+ x %= 60 ;
2784
+ tm -> tm_sec = x ;
2785
+ }
2788
2786
2789
2787
if (tmfc -> cc )
2790
2788
tm -> tm_year = (tmfc -> cc - 1 ) * 100 ;
You can’t perform that action at this time.
0 commit comments