00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00013
00014 #define UTILBD_H
00015
00016 #include "jic/exc/excepcion.hpp"
00017 #include <stdio.h>
00018
00019 #define FMT_FECHA_CADENA_BD "'YYYY-MM-DD HH24:MI:SS'" // @@ De momento como macro
00020
00021 namespace BD
00022 {
00023 namespace UTIL
00024 {
00025 EXCEPCION(ExcBD);
00026 EXCEPCION_DE(ExcBD,ExcConvBD);
00027
00028
00029
00030 static const int SIZE_FMT_FECHA_CADENA_BD = 23;
00031 static const int SIZE_FECHA_CADENA_BD = 19;
00032 static const char * strFmtDate = "%4d-%02d-%02d %02d:%02d:%02d";
00033
00034
00035
00036
00037
00038 std::string ts_to_bdDate(const time_t timestamp);
00039
00040
00041
00042
00043
00044
00045
00046
00047 std::string genDateSentenceFromDate(std::string strDate);
00048 std::string genDateSentenceFromVar(std::string strVar);
00049
00050
00051
00052 time_t bdDate_to_ts(std::string fecha);
00053
00054
00055
00056
00057
00058 std::string bdDateColumn_to_char(std::string strName);
00059
00060
00061 time_t dateTokens_to_ts(int nYear,
00062 int nMongh,
00063 int nDay,
00064 int nHour,
00065 int nMin,
00066 int nSec);
00067
00068
00069
00070 }
00071 }
00072
00073 #endif
00074