My VB is very rusty, but can you use DateTime.UtcNow instead of Now?

On Thu, Jul 2, 2009 at 17:21, danksoft <danks...@gmail.com> wrote:

>
> I'm using VB6, heres my code in case you know it...
>
> Dim iSec As Long
> Dim iNow As Long
>
> iSec = Parsed time from XML
> iNow = DateDiff("s", #1/1/1970#, Now, vbUseSystemDayOfWeek,
> vbUseSystem)
>
> So then I do iSec - iNow which gives me 12:00 but that still isn't
> right...
>
> On Jul 2, 3:57 pm, JDG <ghil...@gmail.com> wrote:
> > Obviously, that will only work in your time zone. What language are you
> > using? Most have a way to get the current time in UTC time as opposed to
> > local time.
> >
> >
> >
> > On Thu, Jul 2, 2009 at 16:54, danksoft <danks...@gmail.com> wrote:
> >
> > > Wow I feel stupid lol. I noticed I have to subtract 8 hours from it.
> >
> > > On Jul 2, 3:42 pm, danksoft <danks...@gmail.com> wrote:
> > > > Ok, the difference I'm getting is still 8 hours...
> >
> > > > 7/2/2009 11:41:23 PM(epoch time) : 7/2/2009 3:40:56 PM(current time)
> >
> > > > Am I still doing something wrong?
> >
> > > > On Jul 2, 2:19 pm, Matt Sanford <m...@twitter.com> wrote:
> >
> > > > > Yup. In all likelihood your programming language or environment
> > > > > already has a function for getting the current epoch time and you
> can
> > > > > just subtract the two to find out the number of seconds remaining.
> >
> > > > > — Matt
> >
> > > > > On Jul 2, 2009, at 2:10 PM, danksoft wrote:
> >
> > > > > > So I would just get the UTC time convert it to a date and find
> the
> > > > > > difference in time between UTC time and time now?
> >
> > > > > > On Jul 2, 1:33 pm, Matt Sanford <m...@twitter.com> wrote:
> > > > > >> Hello there,
> >
> > > > > >>      The reset-time-in-seconds is a the UNIX time (a.k.a Epoch
> time,
> > > > > >> number of seconds since 1970-01-01 UTC) at which the rate limit
> will
> > > > > >> reset.
> >
> > > > > >> Thanks;
> > > > > >>   – Matt Sanford / @mzsanford
> > > > > >>       Twitter Dev
> >
> > > > > >> On Jul 2, 2009, at 1:05 PM, danksoft wrote:
> >
> > > > > >>> Hi, I'm creating a small app like TweetDeck and was wondering
> how
> > > to
> > > > > >>> calculate the correct time when your rate limits reset...
> >
> > > > > >>> The XML I parsed is:
> > > > > >>> <reset-time-in-seconds
> type="integer">1246568101</reset-time-in-
> > > > > >>> seconds>
> >
> > > > > >>> So in order to convert seconds to minutes you do seconds
> > > > > >>> 0.0166666666666667 * 1246568101
> > > > > >>> Therefore, 1246568101 seconds = 20776135.016666666 minutes
> >
> > > > > >>> Which is not right if limits are reset every 60 mins.
> >
> > --
> > Internets. Serious business.
>



-- 
Internets. Serious business.

Reply via email to