How to store date in IST format in MongoDb - mongodb

Unable to store date in IST format in mongo DB
Currently storing date in UTC format during every operations i have to change it into IST format using timezone feature provided by mongo

You can not do that. MongoDB will always save time in UTC.
MongoDB stores times in UTC by default, and converts any local time
representations into this form. Applications that must operate or
report on some unmodified local time value may store the time zone
alongside the UTC timestamp, and compute the original local time in
their application logic.
You can check the official docs for more info.

Related

Kafka Connect JDBC db.timezone config

I'm trying to wrap my head around how the db.timezone property works on both the source and sink connectors.
For the source the docs say:
Name of the JDBC timezone used in the connector when querying with time-based criteria. Defaults to UTC.
What does this actually mean? Is that supposed to be set to the timezone of my source database? I have a db that is set to eastern timezone. Do I need to set this to US/Eastern? If I don't what will it do?
On the sink side the docs say:
Name of the JDBC timezone that should be used in the connector when inserting time-based values. Defaults to UTC.
Again what exactly does this mean. Does it use that to convert the all timestamps in your payload to the value you give here?
My specific problem is my source db has eastern timezone, but my sink db is set to UTC and I can't change it. How should I define these properties.
Also to add to this, I think it's slightly unrelated but I notice on my sink side the timestamps don't have all the decimals. But on both sides in have the timestamp columns set to timestamp(6). However on the sink side the decimal points always only just have 3 digits and the remaining 3 are all 0s. Why would this be?
Have a look at the source code:
https://github.com/confluentinc/kafka-connect-jdbc/blob/master/src/main/java/io/confluent/connect/jdbc/source/JdbcSourceConnectorConfig.java#L805
to get a feeling on how the value you specify for the db.timezone configuration option will be used by the kafka-connect-jdbc connector.
I'd assume that for your source connector you should use
db.timezone=US/Eastern
Name of the JDBC timezone used in the connector when querying with time-based > criteria. Defaults to UTC.
What does this actually mean?
The db.timezone setting comes in handy when reading/writing data from databases which don't use UTC timezone for storing the date/time columns.
Since your sink database uses UTC timezone, there's no additional setting related to setting the timezone in your jdbc sink configuration.

Some date values off by a day in JDV

When querying a source model in a VBD, with the source database being Informix 11, the values for a date column are sometimes returned as the prior day. For example, the actual value in Informix is Oct 10, but value shown when querying JDV source model is Oct 9. Querying Informix directly returns the correct date. I'm using JDV 6.4.0 with JDK 1.8.0_162 (x64) on Windows 10.
Any ideas? Thanks in advance!
To elaborate on what Ramesh is saying, you need to check the client and server jvm timezones. JDV will attempt to keep date/time calendar fields consistent across db, server, and client. If the Teiid client is in a different timezone than the server, the client will automatically alter UTC value for date/time values so that they match what the server would display - which is determined by the server timezone.
When a timestamp value is retrieved from the database we assume that it has already been adjusted by the driver to account for any timezone differences. If that is not the case there is a translator execution property called DatabaseTimeZone that will utilize the JDBC calendar based methods to adjust the retrieved date/time values.
A common issue would is a mismatch of daylight savings times - usually it's best to have the JDV server in a standard timezone.

Change hour mongo [with sails]

I have got mongo allocated in Mongolab and when I save some registers in the database, I am sending a specific date, in database it is saved with 4 hours more.
How I can change this timezone?? I am using Sails

MS access date format

I have an ODBC connection to an informix database from a MS Access database and want to show the time in a query as held in the native database i.e. "dd/mm/yy hh:nn:ss.000". It seems that no matter what format I try in Access I cannot emulate this, although I can do this in MS Excel!?
I've used, amongst others, but to no avail:
Format([startdatetime],"dd/mm/yy hh:nn:ss.000")
Format([startdatetime],"dd/mm/yy hh:nn:ss,SSS")
Any ideas?
Try:
Format([startdatetime],"dd/mm/yyyy hh:nn:ss AM/PM")
If you need to store Access dates to the millisecond, have a look here.

How to filter the data for JDE object browser in date format?

I am new user for JDE and JDE Data browser as well. But for what I know the JDE data browser only enables us to do create some filter condition for our data.
Let say I wish to get the data in a range of dates (Example:20/11/2009 To 8/9/2012).
What comment should I put on JDE Data browser? or the JDE data browser didn't support this function?
The JDE Data browser nor the UTB have that capability. You could achieve this only if you had the field two times in your table. It could be achieved via SQL, but then you would have to face data conversion since JDE store data differently that what it display (dates are stored in julian format).
So the answer to your question: you cannot query a date range on one column in the data browser.
Work around: query via SQL, but you will have data conversion to do.
have a good day