How do I define a function detailing 30 days ago in ssrs? - ssrs-2016

I need to define a parameter default value in a function that describes 30 days ago using report builder. What would I put in my expression? I tried using =Now()-30 but it returns the following error.

So I found the answer here
=DateAdd("d", -30, Today())

Related

Understanding GTFS service times

I have a problem with the understanding of the gtfs file format. Or maybe there is an error in that data. There is a gtfs file from a public transportation agency called "Verkehrsverbund Mittelthüringen" (VMT). This data is accessible at https://transitfeeds.com/p/verkehrsverbund-mittelth-ringen/1080/latest/routes.
For example: I have taken the trip with the ID 9782458 (trips.txt).
2841_0,45,9782458,"Erfurt, Thüringenhalle","",0,,,,
This has the service ID 45 with the specification
45,0,0,0,0,0,0,0,20191101,20200229
Additionally here are the entries for the celendar_dates.txt
45,20191104,1
45,20191111,1
45,20191118,1
45,20191125,1
45,20191202,1
45,20191209,1
45,20191216,1
45,20191105,1
45,20191112,1
45,20191119,1
45,20191126,1
45,20191203,1
45,20191210,1
45,20191217,1
45,20191106,1
45,20191113,1
45,20191120,1
45,20191127,1
45,20191204,1
45,20191211,1
45,20191218,1
45,20191107,1
45,20191114,1
45,20191121,1
45,20191128,1
45,20191205,1
45,20191212,1
45,20191219,1
45,20191101,1
45,20191108,1
45,20191115,1
45,20191122,1
45,20191129,1
45,20191206,1
45,20191213,1
45,20191220,1
Does this mean, that the service is available all times, except from the 1st November 2019 to the 29th February 2020? My Problem now is the output of the search engine tansitfeeds.com. It says the trip with the ID 9782458 is available at the 14th November 2019. Which is contary to my understanding of the data: the trip won't be available in November. Where is the clue I missed? Or is there an error in the data?
The line you pasted indicates that service ID 45 runs on zero days of the week (that's what all those zeros mean), so the start and end dates in the same line don't really mean anything.
If this service actually does run on Nov. 14, this could be represented in the calendar_dates.txt file, which is usually used to represent service changes for special dates.
EDIT: the data you added from calendar_dates.txt does indeed show that service 45 has been added for date 20191114.

The following code has been giving me the same output for a long time

I have been writing some code with PRAW. I want the following to give the top posts each day.But it has been returning the same ids even though new posts are submitted each day and different posts are at the top. What should I do?
import praw
reddit=praw.Reddit(client_id='id',
client_secret='secret',password='password',
user_agent='agent',username='username')
top_funny=subreddit.top(limit=1)
for submission in top_funny:
print(submission)
by default subreddit.top() returns the top of all time. You can change this by using the time_filter parameter and specify any of the following: hour, day, week, month, year, all.
ex:
subreddit.top("day", limit=1)
will return the top submission from today.
As LampToast said, you should use the time_filter.
Arguments for .top() are listed in the docs:
Parameters: time_filter – Can be one of: all, day, hour, month, week, year (default: all).
https://praw.readthedocs.io/en/latest/code_overview/models/multireddit.html#praw.models.Multireddit.top

How Do You Represent Tomorrow Morning?

Using momentjs, I am trying to represent tomorrow at 7:00 AM (in server time).
Something like this:
var tomorrowEarlyAm = moment().add(1, 'day').add(7, 'hour');
However, of course, adding 1 day means we are at this same time tomorrow, so adding 7 hours is basically adding 31 hours.
The difficulty is that I don't know a simple way of clipping this to midnight:
var tomorrowMidnight = moment().add(1, 'day').??
basically you can go to today's 12 AM by using .startOf('day') and then add one day .add(1, 'day') and then 7 hours .add(7, 'hour')
all to gather as bellow,
moment().startOf('day').add(1, 'day').add(7, 'hour');
as suggested by #Mat J
or you may add 31 hours directly
moment().startOf('day').add(31, 'hour');

how to get hours and minutes using time.localtime in python

I have the folling line of code which returns the hour, but how do i get hours and minutes, preferable in this format 7:45.
print(time.localtime().tm_hour)
been racking my brain for hours trying to solve this but i am only new to python lol.
Thank you in advance for your help.
Function strftime() displays the local time by default:
time.strftime('%H:%M')
#'03:34'

Records get skipped Due to timeZone difference between Server and cllients in Nodejs Rethinkdb?

iam filtering some records from my Rethinkdb . the code works just fine when i use the following code . but it works with date only
(new Date(filter.fromdate+' 00:00 GMT+00:00'));
the line above works perfect even after the server is on different region. By using above . It wont skipp any records and time and date just works fine .
but when i use date with time it throws error of rangeError invalid time
I am saving date in rethink in the following format Mon Feb 20 2017 07:25:27 GMT+00:00
SomeHow i just need time with my date to work with the above mentioned code or may be other method can also be used .
Ok, so you need to check if filter.fromdate is with time:
If with time don't add your time and modify it with the proper method of Date , otherwise if is a date without time add your time. And remember you can use momentjs instead of Date to handle dates. Hope help you man.

Resources