Changeset 1086


Ignore:
Timestamp:
Aug 2, 2003, 2:39:06 PM (17 years ago)
Author:
luba
Message:
  • 0 is added to milliseconds if the number is < 10;
  • date and time were changed to terms of type_short_int
File:
1 edited

Legend:

Unmodified
Added
Removed
  • to-imperative/trunk/library/Dos/time.cc

    r1077 r1086  
    99#include <sys/time.h>
    1010#include <locale.h>
    11 #include <langinfo.h>
    1211
    1312namespace refal
     
    3231
    3332  char s[256];
    34   strftime(s, sizeof(s), "%d %b %G %H:%M:%S", lt);
    3533
    36   e_String = Char::create_expr(s) +
    37              Char::create_expr(".")+
    38              ShortInt::create_expr(uu) ;
     34  strftime(s, sizeof(s), " %b ", lt);
     35
     36  Expr e = ShortInt::create_expr((*lt).tm_mday) +
     37           Word::create_expr(s) +
     38           ShortInt::create_expr((*lt).tm_year + 1900) +
     39           Char::create_expr(" ") +
     40           ShortInt::create_expr((*lt).tm_hour) +
     41           Char::create_expr(":") +
     42           ShortInt::create_expr((*lt).tm_min) +
     43           Char::create_expr(":") +
     44           ShortInt::create_expr((*lt).tm_sec) +
     45           Char::create_expr(".");
     46
     47  if (uu < 10)
     48    e = e + ShortInt::create_expr(0) +
     49            ShortInt::create_expr(uu);
     50  else
     51    e = e + ShortInt::create_expr(uu);
     52
     53  e_String = e;
    3954
    4055RF_END
    41 
    4256}
    43  
    4457}
    4558
Note: See TracChangeset for help on using the changeset viewer.