how to change timezone setting in Lucid Work Enterprises - solr

I have installed Lucid Work Enterprises and notice that its displaying time of UTC zone. But my system timezone is UTC+05:30. so there is always a difference in my database last_modified field value for delta query for indexing (as there is 5:30 Hrs difference in Lucid admin timezone and my database timezone).
I tried to change a setting in start.bat file from
"set MISC_OPTS2=-Duser.language=en -Duser.country=US -Duser.timezone=UTC -Dfile.encoding=UTF-8"
to
"set MISC_OPTS2=-Duser.language=en -Duser.country=US -Duser.timezone=UTC+05:30 -Dfile.encoding=UTF-8"
But it doesn't make any difference.
I am unable to find a way to change timezone setting in Lucid admin area. Even there was no option to select timezone in installation wizard.
Please help me that how i can change this timezone setting for Lucid.
Thanks in advance

I had a similar issue using lucen/solr (without LWE). At solr ther is (also) no way to configure the timezone. Asking an Partner from "Lucid imagination" how to handle time-zones with lucene/solr, i get the answer: change timezone-settings at your J2EE servlet container options.
But as you said:
But it doesn't make any difference.
My workaround is realized by the application, which handles the "time-zone-difference" between lucene- and database timestamp. Not sure, which programming language you are using. PHP for example provides nice build-in functionality for handling dateTime objects and different timezones.

Related

How to avoid the "Z" in my PostgreSQL datetime

I am using the material-UI to select a date and store it in a SQL Database. When I send the date to the DB it is in this format "YYYY-MM-DDTHH:MM" for example "2017-05-24T10:30". However when I fetch the dates from the DB they come out like this "YYYY-MM-DDTHH:MM:SS.000Z" for example "2019-06-14T10:30:00.000Z"
Now I am using a calendar package called FullCalendar, which interprets the "Z" as -5H. So all of the dates on my calendar are moved back 5H. The really bazaar thing is that this only happens when the app is deployed on Heroku. If I run the app locally and try to fetch the dates the database is automatically adding 5H to the times to compensate for the "Z" and the dates are displayed correctly on the calendar.
I'm looking for a solution to either get rid of the "Z" or make the heroku and local app deployments consistent.
I'm not sure if there is any relevant code to include here. The POST and GET methods to the DB are pretty standard. Let me know if I can add anything that might be of use.
Without more information, this will be the easy solution (not the best):
SELECT LEFT(cast('2019-06-14T10:30:00.000Z' AS varchar),16)
Result: "2019-06-14T10:30"
Look at these functions for better answers in terms of performance: AT TIME ZONE, date_trunc
https://www.postgresql.org/docs/9.1/functions-datetime.html

Is date modified of the files shows that the file has been used by lighttpd or not?

IS date modified of the files shows that the file has been used by lighttpd or not?
I am trying to clean my hardisks becouse they are now a buttle neck problem, they are full of data, I need to know how to find the files that lighttpd didn't stream to users more that 1.5 years to delete thes becouse they are not in use.
Is date modefided is the best solution for that?
Thanks
Absolutely not. Date modified is not a good indication of access.
If you have web logs, you should consult those for what was served by lighttpd.
Absent that, you might look at atime (access time) instead of mtime (modification time) if your server is configured to track atimes and you do not have anything crawling the volume which would update the atimes. (You'll have to look at your server yourself to answer that question. Nobody can answer it for you.)

Serializing dates to JSON seems to alter the date one hour back

I'm trying to understand why dates stored in my MSSQL server are being altered back one hour when I view them in JSON format.
Here is the Datetime date stored in MSSQL
2015-08-12 00:00:00.000
Here is debug mode in Visual Studio showing that the date "appears" to be retrieved correctly from the database.
{8/12/2015 12:00:00 AM}
And here is the JSON output - the date is one hour earlier! I see that the json timezone is -6, and the database timezone doesn't appear to have that, but I don't have any special settings in my web api config. I'm really not understanding what is going on here. Appreciate any help.
"2015-08-11T23:00:00-06:00",
Edit: My pictures didn't show up so I edited to show the dates in text format - hope that is allright.
When moving to OData V4 (from earlier versions) one of the first 'hickups' we run into is that V4 does not support 'DateTime' but 'DateTimeOffset'. In .Net terms we're moving from a "Date assumed to be in locale timezone of the server running it" to "DateTimeOffset" which explicitly included the timezone information itself.
OWin will emit the DateTimeOffset based on your thread's culture info. Your solution will then lie in making sure when converting between "DateTime" and "DateTimeOffset" (DB/EF and OWin respectively) that you don't rely on your local thread's locale setting, but force it to be considered UTC.

extracting the time zones from the windows 7 clock

I have been demanded to go to the clock on windows 7 then to the "change time zone ..." box
and from the drop down list that will show to you after clicking on the change time zone box , you will see different time zones ,i have to take these field exactly and inter it in the database , is there a way to extract these filed to a file ,, or to extract it to the database quickly
If you really had to do this from PHP, you could capture the output from the Windows command line command tzutil /l. Or, you could read from the Windows registry at the following location: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones.
But what would be the point? PHP doesn't use Windows time zones. It uses IANA zones. See the PHP docs and the timezone tag wiki.
Besides, once you put it in a text file or a database, you now just have a snapshot copy of it. When Windows Update rolls out changes, you won't get them.

Cake PHP timezone wrong

I got a strange problem with Cake. I live in Germany. When I add posts the time in the "created" database-field is 6 hours back. E.g. a post created 6pm shows up in the database as created 12am.
I use a managed server and I contacted the company which set the php.ini to the correct timezone Europe/Berlin. When I request the servers php.ini, it shows the timezone "Europe/Berlin" correctly. But when I run the code
$timezone = date_default_timezone_get();
echo "The current server timezone is: " . $timezone;
in CakePHP it shows
The current server timezone is: America/New_York
I already tried to set in the core.php:
date_default_timezone_set('Europe/Berlin');
But that has no effect at all.
Hopefully someone knows what to do.
EDIT 1:
After asking the support to run "locale -a", following was spit out:
# locale -a
C
de_DE
de_DE#euro
de_DE.iso88591
de_DE.iso885915#euro
de_DE.utf8
deutsch
en_US.utf8
german
POSIX
I assume that serverside everything is fine and the error is cake-wise.
But I donĀ“t have a clue what to do next? Maybe someone can help. Thanks in advance.
** EDIT 2: **
After looking around what it could be I found the error in the bootstrap.php of the Usermanagement-plugin, which set the timezone there to UTC. So everything works fine now. Thanks for your help anyway.
Edit:
If doing the answer below has no effect (per OP), it could be this issue:
Is is quite likely that the German locale is not installed on the
server your running the script on - do you have shell access to the
server? Then try
locale -a
to see which locales are installed. Also have a look here Is
it feasible to rely on setlocale, and rely on locales being installed?
TLDR:
You had the right idea - just put it in your Config/bootstrap.php. instead of your Config/core.php.
More Detail:
This is likely the same as this question. It's answer:
Put this in your Config/bootstrap.php:
date_default_timezone_set('UTC'); //or whatever your timezone is
It's just based on the server time and really has nothing to do with
CakePHP - so just change the default timezone with PHP, and you should
be good to go. 'created' and 'modified' will be based on the specified
timezone.
To reiterate, the "created" and "modified" fields ARE based on the server and really don't have much to do with CakePHP (which it sounds like you already assumed correctly).
A related item (just fyi to read up on) is CakeTime::convert(), but in this case, is not what you'd want.
Set in app_controller not in code.php
Problem solved. The problem was in a plugin which also had a config.php. There the Cake-config was overwritten. Now everything is fine.

Resources