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 8303791
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T17:37:36+00:00 2026-06-08T17:37:36+00:00

I have a very strange behavior on an application. The server is in New

  • 0

I have a very strange behavior on an application. The server is in New York(-5 GMT timezone) and the client – me, in Romania(+2 GMT timezone) so there is a 7 hour discrepancy. The problem I’m facing is when I try to save a date, let’s say 12:00(day doesn’t matter), the client is sending a request with the date 12:00, the 12:00 reaches the database but when it returns the severs returns the hour 19:00. I tried to debug on local to see who messes up the date but since I have the same date on server and on client there is no discrepancy.

This is the parameter sent to server &startDate=07/25/2012%2012:00:00

And this is the result: 1343232000000 – the seconds from the epoch(if you use a converter – http://www.epochconverter.com/ – you will see that the date is in fact Wed Jul 25 2012 19:00:00

here are some code snippets :

public static void GetProfessionalsHours(List<long> ids, out List<SalonProfessional> professionals)
    {
        professionals = new List<SalonProfessional>();
        using (SqlConnection conn = new SqlConnection(DbConfig.ConnectionString))
        {
            using (
                SqlCommand command = new SqlCommand("GetProfessionalsHours", conn) { CommandType = CommandType.StoredProcedure })
            {
                conn.Open();
                command.Parameters.AddWithValue("professionalIDs", ids.CommaSeparated());
                using (IDataReader reader = command.ExecuteReader())
                {
                    //get normal schedule
                    while (reader.Read())
                    {
                        professionals.Add(SalonProfessional.GetSalonProfessional(reader));
                    }
                    reader.NextResult();
                    while (reader.Read())
                    {
                        professionals.Find(p => p.ID == reader.GetInt64(1)).Hours.Add(ProfessionalHours.GetProfessionalHour(reader));
                    }
                    //get overriden hours
                    reader.NextResult();
                    while (reader.Read())
                    {
                        professionals.Find(p => p.ID == reader.GetInt64(1)).OverriddenHours.Add(ProfessionalOverriddenHour.GetProfessionalOverriddenHour(reader));
                    }
                }
            }
        }
    }

public static ProfessionalOverriddenHour GetProfessionalOverriddenHour(IDataReader reader)
    {
        return new ProfessionalOverriddenHour()
                   {
                       ID = reader.GetInt64(0),
                       ProfessionalId = reader.GetInt64(1),
                       StartDate = reader.GetDateTime(2),
                       EndDate = reader.GetDateTime(3),
                   };
    }


public JsonResult CalendarData(List<long> professionalIDs, CalendarData calendarData)
    {
        AjaxResponse response = new AjaxResponse();
        response.Success = true;
        CalendarDataResponseObject responseData = new CalendarDataResponseObject();
        response.Content = responseData;

        try
        {
          List<SalonProfessional> professionals = null;
          CalendarOperations.GetProfessionalsHours(professionalIDs, out professionals);
          responseData.Professionals = professionals;

        }
        catch (Exception ex)
        {
            response.Success = true;
            response.ErrorMessage = "Could not retrieve calendar data";
            ExceptionsOperations.LogException(ex, "Could not retrieve calendar data");
        }

        return Json(response, JsonRequestBehavior.AllowGet);
    }

The problem is on StartDate and EndDate from the ProfessionalOverriddenHour object.

  • 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-08T17:37:37+00:00Added an answer on June 8, 2026 at 5:37 pm

    You could send the offset (z) or agree on UTC

        Console.WriteLine(DateTime.Now.ToString("hh mm ss z"));
        Console.WriteLine(DateTime.Now.ToUniversalTime().ToString());
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a very strange behavior with Request.Form . Here are two IIS 7
I have very strange behaviour of Java Date class: System.out.println(new Date().toGMTString()); long l =
I have very strange issues in my application. I added a layout file with
I have a very strange problem when I'm testing my application on device. I
I have a very strange behavior in going on KnockoutJS 1.2.1 (Can't switch to
I've websphere application server 7 network deployment, and am facing a very strange issue,
I am developing an Android application with MapView and I have a very strange
I have encountered something very strange, simple WPF application <Window x:Class=ListBoxSelection.MainWindow xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml Title=MainWindow
I'm a very strange behavior with EF code first approach and associations. I have
We have an iOS application for the iPad that is having strange behavior. We

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.