When symfony updates the Datetime field, the first one cannot be updated successfully, but the second one can. Who knows?
$plan->setPlanAt($plan->getPlanAt()->modify('+7 day')); //fail
$plan->setPlanAt(new \Datetime($plan->getPlanAt()->modify('+7 day')->format('Y-m-d'))); //success
the issue might come from the differences of date time formats on your web server time and database server.
Related
I have Firestore documents that use Timestamp. I've checked every part of my code and I'm 100% sure the Instants I use to create timestamp always contain only dates like 2020-05-01T00:00:00Z. However, when I look a the https://console.firebase.google.com I see strange things. Each timestamp has suddenly additional time in it. It's either 1:00:00 AM UTC+1 or 2:00:00 AM UTC+2.
In order to turn Instant to Timestamp I use this extension:
fun Instant.toTimestamp(): Timestamp {
return Timestamp.ofTimeSecondsAndNanos(this.epochSecond, this.nano)
}
How is it possible that correct data on the client side becomes incorrect when saved? What am I missing here?
I use batch updates and I also checked the mutations it contains and everything is fine there too. I converted all its timestamps back to Instants and none of them contained time. Why do they appear in the console?
Timestamps don't encode a timezone - they are always UTC. However, the Firebase web console displays timestamps using the timezone configuration of the local machine running the browser (for local readability). If you query for the document and get the timestamp back out, it will be the same as the time you put in (again, internally represented in UTC).
I'm trying to update a sabre Profile using Sabre_OTA_ProfileUpdateRQ. I get the error message
Invalid Last Update Time Stamp. Profile probabaly has been updated by another client
I've tried sending the "last modified" date on the profile on our side, as well as the "last sync with Sabre" timestamp. Both result in the same error message. What are the requirements for this field?
Thanks
Simon
Turns out the two timestamps must exactly match the ones stored in Sabre. (read: match whatever is returned in Sabre_OTA_ProfileReadRS
I am working on a project where you book hotel reservations.In the add booking page, I have an input datetime-local where the user selects the date and the time of the booking.
I want to get the online time and not use the device time to disable the user from booking past datetimes.
I tried to get the server time Timestamp from Firebase but did not know how to work with it.
I want to know what is the best way to deal with this issue.
For firebase3, use firebase.database.ServerValue.TIMESTAMP
$scope.createdDate = firebase.database.ServerValue.TIMESTAMP
doc is available here
and for date time picker go for this code.
I'm working on an asp.net website that clients create events and users register for these events. After much reading on the subject of how to store and display datetime, I'm still confused about which route to take.
The most accepted solution (after searching on the subject) is store everything in UTC and substract clients's time zone offset for display. The alternative would be to store the datetime in event's time zone (local time of location of the event, not server) and display it as is to the client when requested. Wouldn't that be more efficient? Am I missing something? Do the daylight savings are taken into account that way?
Thanks in advance.
Storing everything in UTC is the standard for a reason.
Your alternative of storing your events in local time will cause the confusion to users in different timezones to when the event actually took place.
Using the event's location time zone as a reference point, we can do this to get the current local time (in .NET 3.5 or 4.0):
string EventTimeZoneId = "GTB Standard Time"; // for instance, this should be stored in DB as varchar[32]
DateTime EventLocalTime = TimeZoneInfo.ConvertTimeBySystemTimeZoneId(DateTime.UtcNow, EventTimeZoneId);
This takes into account the daylight savings also. The only drawback I can think of, is that if the client picks the wrong time zone while creating an event, then all registrations will have a wrong time.
if you are using c# asp.net
To store in DB
DateTime CurrntDate= DateTime.SpecifyKind(DateTime.Now,
DateTimeKind.Unspecified); var _utc =
TimeZoneInfo.ConvertTimeToUtc(CurrntDate, TimeZoneInfo.Local);
Get date from db and convert as per client timezone and display.
It will put consistency in your Business Logic.
i have a file with documents.
i wrote a applikation with asp.net.
i need to read the creation date and the date of the last change (and title, etc.)
for that i used the API filesysteminfo.
in the file are documents, that are a copy of a vss server.
but when a document is copied, the date of creation changes to the "date of copy".
but i need the original date of creation.
any idea?
greetings
If the file has been overwritten, you will not be able to get the creation date that is stored in SourceSafe.
You may have more luck using the SourceSafe API, however this uses OLE automation, so may not be very simple.
i solved the problem with robocopy
robocopy source destination [parameter]
default it copies Data, Attributes and Timestamp
http://technet.microsoft.com/en-us/library/cc733145%28WS.10%29.aspx
http://www.microsoft.com/downloads/en/confirmation.aspx?familyId=9d467a69-57ff-4ae7-96ee-b18c4790cffd&displayLang=en