[Gambas-user] [Gambas Bug Tracker] Bug #1068: CDate: strange behavior on first day of year

Jussi Lahtinen jussi.lahtinen at ...626...
Sun Jan 15 16:41:30 CET 2017


Sorry, the date bug was fixed in revision 7983. So 3.9.2 still has the bug.
If your string is in local time, then convert it to date using val().
CDate() assumes UTF and your timezone is UTF+1, thus you see the difference.


Jussi

On Sun, Jan 15, 2017 at 4:41 PM, Gianluigi <bagonergi at ...626...> wrote:

> I forgotten: Yes with exactli same program:
>
> Public Sub Main()
>
>   Print CDate("1/1/2017")
>
> End
>
> 2017-01-15 14:52 GMT+01:00 Gianluigi <bagonergi at ...626...>:
>
> > No Jussi seems all the same.
> >
> > My computer:
> >
> > LANG=it_IT.UTF-8
> > LANGUAGE=it
> > LC_CTYPE="it_IT.UTF-8"
> > LC_NUMERIC="it_IT.UTF-8"
> > LC_TIME="it_IT.UTF-8"
> > LC_COLLATE="it_IT.UTF-8"
> > LC_MONETARY="it_IT.UTF-8"
> > LC_MESSAGES="it_IT.UTF-8"
> > LC_PAPER="it_IT.UTF-8"
> > LC_NAME="it_IT.UTF-8"
> > LC_ADDRESS="it_IT.UTF-8"
> > LC_TELEPHONE="it_IT.UTF-8"
> > LC_MEASUREMENT="it_IT.UTF-8"
> > LC_IDENTIFICATION="it_IT.UTF-8"
> > LC_ALL=
> >
> >
> > Wife computer:
> >
> > LANG=it_IT.UTF-8
> > LANGUAGE=it
> > LC_CTYPE="it_IT.UTF-8"
> > LC_NUMERIC="it_IT.UTF-8"
> > LC_TIME="it_IT.UTF-8"
> > LC_COLLATE="it_IT.UTF-8"
> > LC_MONETARY="it_IT.UTF-8"
> > LC_MESSAGES="it_IT.UTF-8"
> > LC_PAPER="it_IT.UTF-8"
> > LC_NAME="it_IT.UTF-8"
> > LC_ADDRESS="it_IT.UTF-8"
> > LC_TELEPHONE="it_IT.UTF-8"
> > LC_MEASUREMENT="it_IT.UTF-8"
> > LC_IDENTIFICATION="it_IT.UTF-8"
> > LC_ALL=
> >
> > [System]
> > Gambas=3.9.2
> > OperatingSystem=Linux
> > Kernel=4.4.0-59-generic
> > Architecture=x86
> > Distribution=Ubuntu 16.04.1 LTS
> > Desktop=XFCE
> > Theme=Cleanlooks
> > Language=it_IT.UTF-8
> > Memory=3018M
> >
> > [Libraries]
> > Cairo=libcairo.so.2.11400.6
> > Curl=libcurl.so.4.4.0
> > DBus=libdbus-1.so.3.14.6
> > GStreamer=libgstreamer-1.0.so.0.802.0
> > GTK+2=libgtk-x11-2.0.so.0.2400.30
> > GTK+3=libgtk-3.so.0.1800.9
> > OpenGL=libGL.so.1.2.0
> > Poppler=libpoppler.so.58.0.0
> > QT4=libQtCore.so.4.8.7
> > QT5=libQt5Core.so.5.5.1
> > SDL=libSDL-1.2.so.0.11.4
> > SQLite=libsqlite3.so.0.8.6
> >
> > [Environment]
> > CLUTTER_BACKEND=x11
> > CLUTTER_IM_MODULE=
> > DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-dw2oWgNV16
> > DEFAULTS_PATH=/usr/share/gconf/xubuntu.default.path
> > DESKTOP_SESSION=xubuntu
> > DISPLAY=:0.0
> > GB_GUI=gb.qt4
> > GDMSESSION=xubuntu
> > GDM_LANG=it
> > GLADE_CATALOG_PATH=:
> > GLADE_MODULE_PATH=:
> > GLADE_PIXMAP_PATH=:
> > GNOME_KEYRING_CONTROL=
> > GNOME_KEYRING_PID=
> > GPG_AGENT_INFO=/home/<hostname>/.gnupg/S.gpg-agent:0:1
> > GTK_IM_MODULE=
> > GTK_OVERLAY_SCROLLING=0
> > HOME=/home/<hostname>
> > IM_CONFIG_PHASE=1
> > INSTANCE=
> > JOB=dbus
> > LANG=it_IT.UTF-8
> > LANGUAGE=it
> > LOGNAME=<hostname>
> > MANDATORY_PATH=/usr/share/gconf/xubuntu.mandatory.path
> > PATH=/home/<hostname>/bin:/home/<hostname>/.local/bin:/
> > usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:
> > /usr/games:/usr/local/games:/snap/bin
> > PWD=/home/<hostname>
> > QT4_IM_MODULE=
> > QT_ACCESSIBILITY=1
> > QT_IM_MODULE=
> > QT_LINUX_ACCESSIBILITY_ALWAYS_ON=1
> > QT_STYLE_OVERRIDE=gtk
> > SESSION=xubuntu
> > SESSIONTYPE=
> > SESSION_MANAGER=local/<hostname>:@/tmp/.ICE-unix/
> > 1203,unix/<hostname>:/tmp/.ICE-unix/1203
> > SHELL=/bin/bash
> > SHLVL=0
> > SSH_AUTH_SOCK=/run/user/1000/keyring/ssh
> > TZ=:/etc/localtime
> > UPSTART_EVENTS=started xsession
> > UPSTART_INSTANCE=
> > UPSTART_JOB=startxfce4
> > UPSTART_SESSION=unix:abstract=/com/ubuntu/upstart-session/1000/1042
> > USER=<hostname>
> > XAUTHORITY=/home/<hostname>/.Xauthority
> > XDG_CONFIG_DIRS=/etc/xdg/xdg-xubuntu:/usr/share/upstart/
> > xdg:/etc/xdg:/etc/xdg
> > XDG_CURRENT_DESKTOP=XFCE
> > XDG_DATA_DIRS=/usr/share/xubuntu:/usr/share/xfce4:/usr/
> > local/share/:/usr/share/:/var/lib/snapd/desktop:/usr/share
> > XDG_GREETER_DATA_DIR=/var/lib/lightdm-data/<hostname>
> > XDG_MENU_PREFIX=xfce-
> > XDG_RUNTIME_DIR=/run/user/1000
> > XDG_SEAT=seat0
> > XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0
> > XDG_SESSION_DESKTOP=xubuntu
> > XDG_SESSION_ID=c1
> > XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session0
> > XDG_SESSION_TYPE=x11
> > XDG_VTNR=7
> > XMODIFIERS=
> >
> >
> >
> > Regards
> >
> > Gianluigi
> >
> >
> > 2017-01-15 0:24 GMT+01:00 Jussi Lahtinen <jussi.lahtinen at ...626...>:
> >
> >> With the exactly same program? Then maybe the computers have different
> >> localization settings. Try command "locale" on terminal to see if there
> >> are
> >> differences.
> >>
> >>
> >> Jussi
> >>
> >> On Sat, Jan 14, 2017 at 9:28 PM, Gianluigi <bagonergi at ...626...> wrote:
> >>
> >> > But in another computer with 3.9.2 the result is 01/01/2017 00:00:00
> >> >
> >> > 2017-01-14 20:13 GMT+01:00 Jussi Lahtinen <jussi.lahtinen at ...626...>:
> >> >
> >> > > It's because of timezone conversion. Not a bug.
> >> > >
> >> > >
> >> > > Jussi
> >> > >
> >> > > On Sat, Jan 14, 2017 at 8:42 PM, <bugtracker at ...3416...> wrote:
> >> > >
> >> > > > http://gambaswiki.org/bugtracker/edit?object=BUG.
> 1068&from=L21haW4-
> >> > > >
> >> > > > Gianluigi GRADASCHI added an attachment:
> >> > > >
> >> > > > CDateTest-0.0.1.tar.gz
> >> > > >
> >> > > >
> >> > > >
> >> > > > ------------------------------------------------------------
> >> > > > ------------------
> >> > > > Developer Access Program for Intel Xeon Phi Processors
> >> > > > Access to Intel Xeon Phi processor-based developer platforms.
> >> > > > With one year of Intel Parallel Studio XE.
> >> > > > Training and support from Colfax.
> >> > > > Order your platform today. http://sdm.link/xeonphi
> >> > > > _______________________________________________
> >> > > > Gambas-user mailing list
> >> > > > Gambas-user at lists.sourceforge.net
> >> > > > https://lists.sourceforge.net/lists/listinfo/gambas-user
> >> > > >
> >> > > ------------------------------------------------------------
> >> > > ------------------
> >> > > Developer Access Program for Intel Xeon Phi Processors
> >> > > Access to Intel Xeon Phi processor-based developer platforms.
> >> > > With one year of Intel Parallel Studio XE.
> >> > > Training and support from Colfax.
> >> > > Order your platform today. http://sdm.link/xeonphi
> >> > > _______________________________________________
> >> > > Gambas-user mailing list
> >> > > Gambas-user at lists.sourceforge.net
> >> > > https://lists.sourceforge.net/lists/listinfo/gambas-user
> >> > >
> >> > ------------------------------------------------------------
> >> > ------------------
> >> > Developer Access Program for Intel Xeon Phi Processors
> >> > Access to Intel Xeon Phi processor-based developer platforms.
> >> > With one year of Intel Parallel Studio XE.
> >> > Training and support from Colfax.
> >> > Order your platform today. http://sdm.link/xeonphi
> >> > _______________________________________________
> >> > Gambas-user mailing list
> >> > Gambas-user at lists.sourceforge.net
> >> > https://lists.sourceforge.net/lists/listinfo/gambas-user
> >> >
> >> ------------------------------------------------------------
> >> ------------------
> >> Developer Access Program for Intel Xeon Phi Processors
> >> Access to Intel Xeon Phi processor-based developer platforms.
> >> With one year of Intel Parallel Studio XE.
> >> Training and support from Colfax.
> >> Order your platform today. http://sdm.link/xeonphi
> >> _______________________________________________
> >> Gambas-user mailing list
> >> Gambas-user at lists.sourceforge.net
> >> https://lists.sourceforge.net/lists/listinfo/gambas-user
> >>
> >
> >
> ------------------------------------------------------------
> ------------------
> Developer Access Program for Intel Xeon Phi Processors
> Access to Intel Xeon Phi processor-based developer platforms.
> With one year of Intel Parallel Studio XE.
> Training and support from Colfax.
> Order your platform today. http://sdm.link/xeonphi
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>



More information about the User mailing list