php - Checking if post is within 24 hours -


I am working on a WordPress site. There is an additional date field in my posts, and I only post that I am trying to demonstrate if the area of ​​that date is within the next 24 hours. I have a WordPress query that is about to grab only the most recent posts, and I only want to show this division if the date of the post is within next 24 hours I found:

  & lt ;? Php $ webnars = get_posts ('post_type = webinar and posts_per_page = 1'); Forex Currency ($ webnar $ as post): setup_postdata ($ post); $ WebDate = Stromatom (get_field ("next_live")); ? & Gt; & Lt; div class = "footer_alert" & gt; & Lt; div class = "wrapper_inner" & gt; & Lt; div class = "footer_alert_inside" & gt; & Lt; A href = "& lt ;? php the_permalink ();? & Gt; & Gt; Upcoming Live Webinar - & lt ;? Php counter date ('mj, y', stroke (get_field ('next_live')); ? & Gt; & Lt; / A & gt; & Lt; Br / & gt; & Lt ;? Php if ($ webDate & gt; time () + 75000) {echo 'yes'; } Else {echo 'no'; }? & Gt; & Lt; / Div & gt; & Lt; div class = "footer_exit" & gt; & Lt; P & gt; & Lt; i class = "fa fa-camera-retro fa-lg" & gt; & Lt; / I & gt; Exit & lt; / P & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt ;? php endforeach; wp_reset_postdata (); ? & Gt;   

Returns the result of running strontem () on the date field in the post at this time: 1398124800 today's time () comes back to this time: 13 9 8095699

The time of the post - The current time gives us this: 29101

Now, obviously the returning number Less than 75,000, why is it falling in the other statement? And is there no resonance? Am I doing something wrong with formatting? I took most code from this post:

part:

  ($ webDate & gt; Time () + 75000)   

Translates your numbers into:

  if (1398124800> 1398095699 + 75000 )   

or

  if (1398124800> 1398170699)   

or

  If (false)   

then your second part is activated as expected.

Ps: Why do you use 75000 ? In fact, 24 hours is 86400 seconds.

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -