I'm using Flash Builder 4.5 and trying to accomplish a charts dashboard task and everything works except one thing: the date when pulled from the MySQL, I can't order the columns by it. i don't care (even prefer) to make the dates like 01.06.2011 or 01/06/2011 i just need to do this somehow.
So this is what I'm doing on the service file:
$row->date = new DateTime($row->date);
When testing the operation i can see its pulling the date in this format:
Tue Jun 14 01:00:00 EEST 2011
Thanks!
Related
I'm tryng to make a query on a date type field on MySql db.
I use predicate to generate more complex query.
Path<Date> path = root.get(attribute);
predicate = criteriaBuilder.equal(path, operator.getValue());
where attribute is
public static volatile SingularAttribute<Expiry, Date> dateInsert;
operator.getValue() is
binding parameter [1] as [DATE] - [Tue Feb 02 00:00:00 CET 2021]
Query return empty result set. I use repository for query.
expiryRepository.findAll(specification,getPageable(currentIndex))
I read a lot of topics about this issue but, no suggested solution works in my case.
Is there possible solution in 2021?
The problem, in my specific case, was caused by different setting of time zone between application and connection. The connection was established with UTC timezone but application works with CET time zone. When in application I did seted the date at 02 Febbruary 2021 at the 00:00 time, the connection changed it in 01 Febbruary 2021 at 11:00 pm time.
I removed this
&serverTimezone=UTC
from connection string, and all works fine.
I'm going to give a brief overview about the app configuration before I go into the query. I am running a Laravel 6 app using MongoDB through Jenssegers MongoDB plugin. So far I have not had to write a raw mongo query and I hope I won't have to for this one too, I mean, I have no idea how to achieve what I want through Eloquent even with SQL, so not sure if possible.
I have three models:
User - standard user details
Availability - Event type model with start_date, end_date, duration, user_id and other unrelated properties
Shift - Event type model with start_date, end_date, duration and other unrelated properties
A User can have many Availability
What I need to do now is for a given Shift, find users that are available to work in that time (from Shift's start_date to end_date). Now that is pretty simple, I do:
User::whereHas('availability', function($query) use ($shift_start, $shift_end) {
$query->where('start_date', '<=', $shift_start)->where('end_date', '>=', $shift_end);
})->get();
All of this works fine, but the users want to be able to create availability like this too:
Availability 1: 21 Sep 2020 14:00 - 21 Sep 2020 23:59
Availability 2: 22 Sep 2020 00:00 - 22 Sep 2020 06:00
What this means is that these two events are kind of "chained" together even though they are two events. This user would technically be available from 21 Sep 2020 14:00 - 22 Sep 2020 06:00 so if the Shift's dates are start: 21 Sep 2020 18:00 end: 22 Sep 2020 04:00, the user should be returned as available for the shift.
I have failed to find a way to include this edge-case into the query and it is what I need help with.
Can you try to make your query as below,
User::whereHas('availability', function($query) use ($shift_start, $shift_end) {
$query->where('start_date', '>=', $shift_start)->where('end_date', '<=', $shift_end);
$query->orwhereBetween('start_date',array($shift_start,$shift_end))
$query->orWhereBetween('end_date',array($shift_start,$shift_start))
})->get();
I'm trying to change some old .asp files with vbs. Our database is going to be converted to store dates in UTC, but on webpages it should show dates and time in "Europe/Helsinki" timezone(
TimeZoneInfo.FindSystemTimeZoneById("FLE Standard Time")
in c#). How can I cast the UTC date I get from db query( the query is run in the .asp file as well and the result put into table) to correct date time using vbscript?
Just offset the UTC dates using DateAdd().
Const EETOffset = -2 'EET offset from UTC is -2 hours
Dim dbDateValue 'Assumed value from DB
Dim newDate
'... DB process to populate dbDateValue
newDate = DateAdd("h", EETOffset, dbDateValue)
Note: One problem with this approach is you will also have to compensate for EET and EEST (Eastern European Summer Time) manually based on the time of year. Which is also more difficult when you take into consideration some places don't use it and use EET all year round instead.
See EET – Eastern European Time (Standard Time).
Depending on the RDMS you are using you should even be able to manipulate the dates before they get to the page as part of the initial query.
Useful Links
Format current date and time
How to format a datetime with minimal separators and timezone in VBScript?
Using Kibana 4.4.1, I seem to be only able to create data table sub-bucket aggregations visualized as rows:
Is there a way to display the aggregation as columns instead?
Invitation time CampaignType:Sms CampaignType:Email
Feb 19th 2016 15:45:00.000 3,185 8
Feb 23rd 2016 17:15:00.000 2,229 11
Feb 24th 2016 15:45:00.000 16,523 38
There are ways to do it.
You may need to filter the columns based on sms and email before doing the visualization , then you may get the appropriate result.
Or with the result that you have , you can export it as Raw or formatted and then allign them according to your needs in Excel.
Specifically, if the report is scheduled for the 31st of every month, at 11:59 PM, I want the report to show data from that month.
Example: Report is run on Jan 31, 2016 11:59 PM. I would like the data to show everything with Task Finish Date from Jan 1, 2016 - Jan 31, 2016.
Thanks!
the simplest way is to create variable which will return for specified dates in cross table zero or one. Then set filter on it and show only 'ones'.
the solution you've provided is also simple - fistdayofmonth might be created by creating new date as year(run_date)+monthnumber(run_date)+"01"