How can I define a cron job which run every 1 minutes from 01:00 to 03:00 and from 10:00 to 12:00?
- description: mycronjob
url: /runmycronjob/
schedule: every 1 minutes from 01:00 to 03:00 and from 10:00 to 12:00
Is this correct?
The schedule format doesn't allow such combination. But you can easily do it from a combination of job schedules:
- description: mycronjob part 1
url: /runmycronjob/
schedule: every 1 minutes from 01:00 to 03:00
- description: mycronjob part 2
url: /runmycronjob/
schedule: every 1 minutes from 10:00 to 12:00
Related
I have a SSIS Package and I need to schedule it to run at 1:00 AM and 1:00 PM every day.
At 1:00 AM it should pass parameters of the previous day for e.g.
15 Nov 2018 12:00 PM as #StartDate & 15 Nov 2018 11:59 PM as #EndDate
At 1:00 PM it should pass parameters of the current day for e.g.
15 Nov 12:00 AM as #StartDate & 15 Nov 11:59 AM as #EndDate
A stored procedure is called through an OLE DB Source Editor task in Data Flow.
Does anyone have any suggestions that How I could achieve this noting the fact that if the job fails at 1:00 PM & it should re-run at 2:00 PM, it should still pass the same parameters.
Here are the steps to pass the date parameters to OLEDB task.
Have start date & end date parameters in (I suppose you must be having).
Assign the dates values to both parameters using SQL task.
Pass these parameters to OLDEB stored procedure to data flow task.
For scheduling:
Create two different jobs for each run, one for 1 AM & another for 2 AM of the job.
For second job run, implement the following steps.
Create a table which log the job execution status with date and time. That table has insertion after each run of the job.
When second job schedule execute first check log table in first step and check the last run status of the job.
If it was successful exit else go to next step.
Hope this will help.
I have a report created in SSRS with 2 parameters "First Start Time" and "Last End Time" in SQL the fields that I'm using for the data set is Tm_TimeDisplay (Ex. 12:00 AM, 1:00 PM ext) and Tm_TimeKey (Ex. 0, 30 ect.). Then I am calling a stored procdure to pull data.
I can display the Tm_TimeDisplay in the parameter dropdown, but how can I use the value of Tm_TimeKey to pull data in a table?
For example: First Start Time: 12:00 PM (field: Tm_TimeDisplay), Last Start Time: 12:30 PM (field: Tm_TimeDisplay), the value that should be used to pull data in SQL are (0,30) (field: Tm_TimeKey)?
Hi i'm working with angular with moment API in GMT timezone.
form
$scope.criteria.fromDate = $scope.criteria.fromDate || moment().startOf('day').hour(moment().hour()).minute(moment().minute()).second(moment().second()).toDate();
to
$scope.criteria.toDate = $scope.criteria.toDate || moment().startOf('day').hour(moment().hour()).minute(moment().minute()).second(moment().second()).toDate();
when I console the from date I got "FROM_DATE" -> "Wed Aug 30 18:30:00 UTC 2017" and to date is Wed Aug 30 18:30:00 UTC 2017
from date is a date with day start time and to date is a date with end day time . that's what i want.
Angularjs date filter issue:
I have following date in my jSon:
2016-11-19T14:00:00
When I am using {{value | date: 'MM/dd/yyyy hh:mm a'}} is shows 11/19/2016 02:00 PM
When I am using {{value | date: 'MM/dd/yyyy hh:mm a' | 'UTC'}} is shows 11/19/2016 17:00 PM
When use JavaScript getHours() it gives time 09
I want to show the date and time in EST format and time zone.
I can able to get time of local sql server by GetDate() function. Sql server machine is in india.
Now I want to get the current datetime of USA on same sql server what can I do.
You need to use the SYSDATETIMEOFFSET call (instead of just GETDATE()) to get your local time with the timezone information:
SELECT SYSDATETIMEOFFSET()
and then you can use the SWITCHOFFSET function to define a new timezone you're interested in - based on UTC time. So the East Coast of the USA would be UTC -5 hours
SELECT SWITCHOFFSET(SYSDATETIMEOFFSET(), '-05:00') AS 'US East Coast'
while the West Coast is UTC -8 hours:
SELECT SWITCHOFFSET(SYSDATETIMEOFFSET(), '-08:00') AS 'US West Coast'
You can do it this way
dateadd(hh,differense_between_India_and_USA,getdate())
Time zones of the USA:
Pacific Standard Time (GMT -8)
Mountain Standard Time (GMT -7)
Central Standard Time (GMT -6)
Eastern Standard Time (GMT -5)
Alaska Standard time (GMT -9)
Hawaii Standard Time and Aleutian Standard Time (GMT -10)
You will get GMT from UTC time (Coordinated Universal Time)
SELECT SYSUTCDATETIME()