Вы не можете работать с датами в VCL. Это всегда сложно сделать правильно, встроенный C, но вы можете начать с:
C{
#include <time.h>
#include <sys/time.h>
}C
sub vcl_fetch {
C{
struct timeval tv;
struct tm result;
gettimeofday(&tv, NULL);
localtime_r(& (tv.tv_sec), &result);
/* compare the timeofday with: result.tm_hour, result.tm_min, result.tm_sec */
if ( result.tm_hour < 12 ) {
/* in the morning, only 1 minute caching */
VRT_l_obj_ttl(sp, 60);
} else {
/* after noon, 1 hour caching */
VRT_l_obj_ttl(sp, 3600);
}
}C
# do other stuff here
}