Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8862197
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T15:40:13+00:00 2026-06-14T15:40:13+00:00

I have been facing this problem where full calendar shows my event at a

  • 0

I have been facing this problem where full calendar shows my event at a time 8 hours later than the event data.
I figured that it is due to my timezone.

This is my trace message

Started GET "/events?custom_param1=something&custom_param2=somethingelse&  start=1351958400&end=1352563200&   authenticity_token=XEXpcBRnQuEivJ2NWjR2+OZ+Uscypalxx+hqGTIiwZA=&_=1352086291522" for 127.0.0.1 at 2012-11-05 11:31:31 +0800
Processing by EventsController#index as JSON
  Parameters: {"custom_param1"=>"something", "custom_param2"=>"somethingelse", "start"=>"1351958400", "end"=>"1352563200", "authenticity_token"=>"XEXpcBRnQuEivJ2NWjR2 OZ Uscypalxx hqGTIiwZA=", "_"=>"1352086291522"}
  Event Load (0.5ms)  SELECT `events`.* FROM `events` WHERE (starts_at > '2012-11-04T00:00:00+08:00') AND (ends_at < '2012-11-11T00:00:00+08:00')
Completed 200 OK in 10ms (Views: 8.2ms | ActiveRecord: 0.5ms)

The problem here being the start time in Unix is Sat, 03 Nov 2012 16:00:00 GMT when I had set it to be 04 Nov 2012 0.00.00.

Here are my codes

class Event < ActiveRecord::Base
  scope :before, lambda {|end_time| {:conditions => ["ends_at < ?",   Event.format_date(end_time)] }}
  scope :after, lambda {|start_time| {:conditions => ["starts_at > ?", Event.format_date(start_time)] }}
  def as_json(options = {})
    {
      :id => self.id,
      :title => self.title,
      :description => self.description || "",
      :start => starts_at.rfc822,
      :end => ends_at.rfc822,
      :allDay => false,
      :recurring => false,
      :url => Rails.application.routes.url_helpers.event_path(id),
      #:color => "red"
    }

  end

  def self.format_date(date_time)
    Time.at(date_time.to_i).to_time.iso8601
  end
end

changing ignoreTimeZone to true didn’t work for me either.
So I would appreciate if someone could help me with it.

Maybe something along the lines of parsing time?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T15:40:14+00:00Added an answer on June 14, 2026 at 3:40 pm

    If you are passing a UNIX time value, it may be in seconds or milliseconds UTC from the epoch (1970-01-01T00:00:00Z). To get a local javascript date object set to the same time in the client’s local timezone, pass the UTC time value directly to the Date constructor.

    e.g.

    // if timeValue is milliseconds
    var localDate = new Date(timeValue);
    
    // if timeValue is in seconds
    var localDate = new Date(timeValue * 1000);  
    

    e.g.

    // For timeValue in milliseconds
    new Date(1352090840000); // 2012-11-05T04:47:20Z
    

    To send back local times as UTC milliseconds since the epoch, do the reverse:

    var utcTimeValue = localDate.getTime();
    

    The time value returned by getTime is UTC milliseconds since epoch.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been facing this problem for quite sometime now. Running 'adb devices' shows
Hell All, So I have been facing this behavior for quite some time and
I have a problem about weblogic console. I have been facing with this problem
Context: An ongoing problem we have been facing is unit testing our market data
I have been facing this problem all day long. I have 2 tables Service
Have been working on this question for a couple hours and have come close
I have been facing the above mentioned problem in my java application that I
I have been facing a strange problem while returning dataset through WCF service (WSHttpBinding).
It's been now 1 week that I am facing this problem. I'm trying to
This is a problem I have been trying to track down for a couple

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.