Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > microsoft.public.excel.programming > #108356

Re: Basic question about dates

From witek <witek7205@gazeta.pl.invalid>
Newsgroups microsoft.public.excel.programming
Subject Re: Basic question about dates
Date 2015-12-17 21:23 -0600
Organization A noiseless patient Spider
Message-ID <n4vu3f$8lu$19@dont-email.me> (permalink)
References <kKadnY_MwPxF7O7LnZ2dnUVZ5sCdnZ2d@giganews.com>

Show all headers | View raw


Robert Crandal wrote:
> Is it possible to determine the integer value of the current date?
>
> For example, I thought this code might help, but it doesn't:
>
>      MsgBox CInt(Date)  ' Returns overflow error
>
> I get the impression that every date in VBA is represented by
> a unique integer.  Is that right?  If so, how do you find the
> integer value for any date?
>
>
>
exactly a unique double because it contains also time


debug.print  cdbl(now())

if you want just a date

debug.print  clng(now())



it is unique number but not exactly Julian Calendar.
Microsoft for compatibility with Lotus123  made the same mistake. 
29-02-1900 does not exist but both count it.


The most tricky part if convert that number back to date.  :)


Back to microsoft.public.excel.programming | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Basic question about dates "Robert Crandal" <noreply2me@yahoo.com> - 2015-12-17 19:39 -0700
  Re: Basic question about dates "Auric__" <not.my.real@email.address> - 2015-12-18 02:54 +0000
    Re: Basic question about dates "Robert Crandal" <noreply2me@yahoo.com> - 2015-12-17 20:15 -0700
      Re: Basic question about dates GS <gs@v.invalid> - 2015-12-17 22:26 -0500
    Re: Basic question about dates "Robert Crandal" <noreply2me@yahoo.com> - 2015-12-22 01:45 -0700
      Re: Basic question about dates Claus Busch <claus_busch@t-online.de> - 2015-12-22 09:58 +0100
        Re: Basic question about dates "Robert Crandal" <noreply2me@yahoo.com> - 2015-12-22 02:26 -0700
          Re: Basic question about dates GS <gs@v.invalid> - 2015-12-22 10:49 -0500
  Re: Basic question about dates witek <witek7205@gazeta.pl.invalid> - 2015-12-17 21:23 -0600

csiph-web