rails - get YYYY-MM-dd date format in string -


i'm not sure why can't figure out it's simple.

i'm trying concatenate todays date in format yyyy-mm-dd string , doesn't work.

i've tried creating date now = time.now.strftime("%y-%m-%d")and concatenating

'http://api.flurry.com/appmetrics/sessions?apiaccesscode=########&apikey=#########&startdate='+now+'&enddate='+now

please advise, thank you.

edit: if set now = '2016-11-05' works fine. issue in how i'm creating date.

i ended making work string interpolation after not working string interpolation. why wasn't working? turns out have use double quotes if not takes interpolation literal!!

now = time.now.strftime("%y-%m-%d")  "http://api.flurry.com/appmetrics/sessions?apiaccesscode=########&apikey=#########&startdate=#{now}&enddate=#{now}" 

Comments

Popular posts from this blog

java - SSE Emitter : Manage timeouts and complete() -

jquery - uncaught exception: DataTables Editor - remote hosting of code not allowed -

java - How to resolve error - package com.squareup.okhttp3 doesn't exist? -